mathertel / RotaryEncoder

RotaryEncoder Arduino Library
Other
328 stars 107 forks source link

request: encoder with button suport (software debounce needed) #13

Closed Ryder17z closed 4 years ago

Ryder17z commented 4 years ago

Title.

FelixHauser commented 4 years ago

I second that. Given that the library works so nicely with the rotary part of the encoder, I just makes sense that it could also support the button, with debouncing included. It would be a large plus.

mathertel commented 4 years ago

In my appliances I have often multiple buttons but only one rotary encoder. I suggest you use the OneButton library for all button inputs and the RotaryEncoder library for the turning events. (By combining both libraries the code size will increase in scenarios with multiple buttons)

FelixHauser commented 4 years ago

Hi there, Thanks for your response. I forked the library and added the bounce functionality for the push button. I literally just sent the push request less than 2 minutes ago. There are no conflicts at all. Users won't have to update the code if they update the library.

mathertel commented 4 years ago

But code size will increase for everybody.

Ryder17z commented 4 years ago

But code size will increase for everybody.

I'd argue it's worth it, because I haven't seen this particular encoder without the pushbutton.