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

Chain Counter Example uses DigitalInputChange() incorrectly #623

Open
BjarneBitscrambler opened this issue Aug 20, 2022 · 0 comments
Open

Comments

@BjarneBitscrambler
Copy link
Contributor

I noticed that the Chain Counter example uses the DigitalInputChange() method incorrectly. The method definition in https://github.com/SignalK/SensESP/blob/main/src/sensesp/sensors/digital_input.h has the argument list as being

DigitalInputChange(uint8_t pin, int pin_mode, int interrupt_type, String config_path = "")

whereas the usage in the example https://github.com/SignalK/SensESP/blob/main/examples/chain_counter.cpp is

auto* button_watcher = new DigitalInputChange( BUTTON_PIN, INPUT, read_delay, read_delay_config_path);

The error is that the example passes a read_delay value where the method expects an interrupt_type. Both values are ints, so the compiler doesn't notice the problem.

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