crycode-de / node-pcf8574

Node.js module for controlling each pin of a PCF8574/PCF8574A I2C port expander IC.
GNU General Public License v2.0
1 stars 2 forks source link

Update to support 2nd poll 50ms after interrupt happens should multiple pins change during interrupt and not be detected. #58

Closed lynniemagoo closed 9 months ago

lynniemagoo commented 9 months ago

What I have seen is behavior such that if multiple inputs are activated and then deactivated, the interrupt handling routing might not detect the changes.

As a workaround for this, I've added a 2nd poll 50ms after this change. I will note that this change puts front and center a requirement for setTimeout to be in the project. This should not likely be an issue as this project requires that NodeJS be present to run.

For now, the default delay is 50ms and wondering if this should be configurable.

lynniemagoo commented 9 months ago

Although this might help, the issue is likely due to bad breadboard connection where interrupt was fired but not detected. Better solution is to setup poll() externally.