Main update is to add isPressed and getPressedState methods, otherwise there is no direct public way to determine whether the button is currently pressed.
Also updated to re-use state variable from Debouncer class. Also addresses #62
Main update is to add isPressed and getPressedState methods, otherwise there is no direct public way to determine whether the button is currently pressed.
Also updated to re-use state variable from Debouncer class. Also addresses #62
As I commented in the source code, the inline functions need to stay private as they are internal to Debouncer and could change in the future. So I agree with the new functions, but not the conversion of the private inline functions to protected ones.
As I commented in the source code, the inline functions need to stay private as they are internal to Debouncer and could change in the future. So I agree with the new functions, but not the conversion of the private inline functions to protected ones.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Main update is to add isPressed and getPressedState methods, otherwise there is no direct public way to determine whether the button is currently pressed.
Also updated to re-use state variable from Debouncer class. Also addresses #62
As I commented in the source code, the inline functions need to stay private as they are internal to Debouncer and could change in the future. So I agree with the new functions, but not the conversion of the private inline functions to protected ones.
I think it's OK to make these methods protected rather than private, but not public, but if you prefer I'll revert that change.
Does this also mean that stateForPressed and pin should also private?
@thomasfredericks , I've updated this as requested.
This is a good feature, for example to determine the state of switches when the microcontroller boots instead of only after a switch state change.
Thanks @jamesmyatt . Merging!
Thanks