Added functions when currentState is provided externally #52

Closed
lathoub wants to merge 2 commits from master into master
lathoub commented 2019-08-25 13:24:23 +03:00 (Migrated from github.com)

Hello,

Thank you for this great library - very helpful.

I have updated your library with functions (update and attach) for when the currentState is provided externally (eg from shift registers for reading a lot of buttons at the same time).
For you to consider.

Thank you
Lathoub

Hello, Thank you for this great library - very helpful. I have updated your library with functions (update and attach) for when the currentState is provided externally (eg from shift registers for reading a lot of buttons at the same time). For you to consider. Thank you Lathoub
thomasfredericks commented 2019-08-26 15:52:43 +03:00 (Migrated from github.com)

The current version of Bounce has the following methods that can be extended by a custom class for custom needs. If you do create a custom class, please share it.

virtual bool readCurrentState()
virtual void setPinMode(int pin, int mode) 
The current version of Bounce has the following methods that can be extended by a custom class for custom needs. If you do create a custom class, please share it. ``` virtual bool readCurrentState() virtual void setPinMode(int pin, int mode) ```
thomasfredericks commented 2019-08-26 15:55:57 +03:00 (Migrated from github.com)

If these methods are not sufficient, please share your needs and I will try to see how the library can me modified to be more extensible.

If these methods are not sufficient, please share your needs and I will try to see how the library can me modified to be more extensible.
lathoub commented 2019-08-27 21:40:15 +03:00 (Migrated from github.com)

No a lot of discussion - you closed the issue right away...
I prefer to have the debounce functionality separate from the (slow) digitalRead

No a lot of discussion - you closed the issue right away... I prefer to have the debounce functionality separate from the (slow) `digitalRead`
thomasfredericks commented 2019-08-27 21:44:44 +03:00 (Migrated from github.com)

The issue is closed because it was already addressed in response to requests by other users. If you are not satisfied with the current implementation I am willing to consider modifications to the way the class can be extended. BUT I do not want to change any of the public methods.

You can change the (slow) digitalRead by overriding virtual bool readCurrentState().

The issue is closed because it was already addressed in response to requests by other users. If you are not satisfied with the current implementation I am willing to consider modifications to the way the class can be extended. **BUT I do not want to change any of the public methods.** You can change the (slow) `digitalRead` by overriding `virtual bool readCurrentState()`.

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Max/thomasfredericks_Bounce2#52