Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HCSR04 over etherport hangs #11

Open
criticalboot opened this issue Sep 22, 2016 · 0 comments
Open

HCSR04 over etherport hangs #11

criticalboot opened this issue Sep 22, 2016 · 0 comments

Comments

@criticalboot
Copy link

criticalboot commented Sep 22, 2016

Setup:

  1. ATMEGA644PU with microduino bootloader.
  2. ENC28j60 for ethernet communication with UIPEthernet
  3. Modified etherport.ino to add proximity capability ( case PING_READ added in sysexCallback ) - files attached StandardFirmataEthernetPlus_UIPEthernet_proximity.zip.
  4. J5: 0.9.23

Issue:
HCSR04 is connected as in J5 wiki to the pin 22.

HCSR is giving correct values for some time, after which it is hanging/ freezing. On investigation we found that onChange is not getting any values but onData is showing constant values.
We noticed that HCSR object is only freezing whereas everything else is working as expected.

Note:
To quickly check we connected the same via serial-port it apparently is working fine.

var this.pinTrig = 22;
this.usSensor = new five.Proximity(
      {controller: 'HCSR04', pin: this.pinTrig}
);
this.usSensor.on('change', data => {
          this.level = data.inches; 
};
this.usSensor.on('data', data => {
          console.log("in: ", data.inches); 
};

Question:
Not sure what is going wrong. Please help us identify where the problem could be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant