Invert #60

Closed
NoobTracker wants to merge 3 commits from invert into master
NoobTracker commented 2020-04-24 20:59:43 +03:00 (Migrated from github.com)

This version adds the function setInvert (bool invert) with which you can invert the read values. This is practical for pins with INPUT_PULLUP, because you can work with buttons on these pins as well as with pins with INPUT. It is programmed to be backward compatible with older programs. It appears that I changed the whole program because I worked on it offline and then replaced the existing file at GitHub.

This version adds the function setInvert (bool invert) with which you can invert the read values. This is practical for pins with INPUT_PULLUP, because you can work with buttons on these pins as well as with pins with INPUT. It is programmed to be backward compatible with older programs. It appears that I changed the whole program because I worked on it offline and then replaced the existing file at GitHub.
todo[bot] commented 2020-04-24 20:59:46 +03:00 (Migrated from github.com)

Make Bounce2 more abstract. Split it from the hardware layer.

Remove deboucing code from Bounce2 and make a new Debounce class from that code. Bounce2 should extend Debounce.


https://github.com/thomasfredericks/Bounce2/blob/000f1fe060e5c18857e476b915e6dae60418854f/src/Bounce2.h#L30-L35


This comment was generated by todo based on a todo comment in 000f1fe060 in #60. cc @NoobTracker.
## Make Bounce2 more abstract. Split it from the hardware layer. Remove deboucing code from Bounce2 and make a new Debounce class from that code. Bounce2 should extend Debounce. --- https://github.com/thomasfredericks/Bounce2/blob/000f1fe060e5c18857e476b915e6dae60418854f/src/Bounce2.h#L30-L35 --- ###### This comment was generated by [todo](https://todo.jasonet.co) based on a `todo` comment in 000f1fe060e5c18857e476b915e6dae60418854f in #60. cc @NoobTracker.
thomasfredericks commented 2020-05-05 23:02:46 +03:00 (Migrated from github.com)

Thank you for your contribution, but Bounce2 does not encompass the notion of an elevated state akin to on/off, pressed or released in which case the inversion would be relevant. I will not merge but I suggest you extend the Bounce2 class instead to keep your modifications compatible.

Thank you for your contribution, but Bounce2 does not encompass the notion of an elevated state akin to on/off, pressed or released in which case the inversion would be relevant. I will not merge but I suggest you extend the Bounce2 class instead to keep your modifications compatible.
NoobTracker commented 2020-05-07 21:22:53 +03:00 (Migrated from github.com)

But isn't this lib primarily for debouncing buttons? At least that was why I downloaded it. And that is very useful, because if the program for pulldown resistors is made and you want to use the internal pullup resistors instead, you have to replace every fell with rose, every rose with felland every read with !read.

But isn't this lib primarily for debouncing buttons? At least that was why I downloaded it. And that is very useful, because if the program for pulldown resistors is made and you want to use the internal pullup resistors instead, you have to replace every fell with rose, every rose with felland every read with !read.
thomasfredericks commented 2020-05-08 14:52:06 +03:00 (Migrated from github.com)

It is for any type of contact. Buttons are the primary use. But sometimes you don't push a button, you slide it, etc. I do not want to invert the HIGH or LOW states because that would not match the electrical reality. It is in the todo to make an extended class of Bounce2 specifically for buttons.

It is for any type of contact. Buttons are the primary use. But sometimes you don't push a button, you slide it, etc. I do not want to invert the HIGH or LOW states because that would not match the electrical reality. It is in the todo to make an extended class of Bounce2 specifically for buttons.
NoobTracker commented 2020-05-08 17:54:22 +03:00 (Migrated from github.com)

Okay, you can cross that off the todo list.

Okay, you can cross that off the todo list.

Pull request closed

This pull request cannot be reopened because the branch was deleted.
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#60