You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to use this library with encoders that don't have pushbuttons? Or if I have encoders that have pushbuttons but don't want to use them in my project, is there any way I can utilize your wonderful library while leaving the pushbutton pins not connected to the board?
It looks like no matter what I need to pass three variables for pin locations in while creating a new Encoder object, so I'm assuming if I just pass in the pins A and B then that won't work...is there perhaps any way I can pass in a null value for the pushbutton pin and still get everything to compile?
The reason I'm not connecting push buttons is to save digital pin space...I've got an Arduino Micro and I'm trying to hook up 5 encoders along with some other switches so all of my digital pins are basically taken up. I may be able to move the switches onto some analog pins and make that work but still, if I can use your library and get away without the pushbuttons I'd love that!
I've tried several other encoder library solutions and none seem to be giving me the result I need so I'd like to give yours a go!
I'm still pretty fresh with Arduino programming so forgive me if this is an easy issue to solve.
Thanks!
Stan
The text was updated successfully, but these errors were encountered:
After some further thinking and researching, I think I have some solutions to my problems...
Option One: this Arduino Micro board I have actually has way more digital pins that I can use than I initially thought...so I may just end up hooking up the pushbuttons regardless!
Option Two: Even if I didn't want to use the pushbuttons, I still could just pass a digital pin that is in use for a different component into the constructor for the Encoder object in order to properly create it, and then I could just do nothing with that data regarding the encoder operation. Just because I assign a pin to create the object doesn't mean I have to use it, and I don't think that will mess up operation of any other component/code that actually IS utilizing that pin, that should all continue to work correctly. Let me know if my train of thought checks out there.
Indeed, you can pass any input pin as the pushbutton, and then just not use it with the library. The encoder should work just fine.
Or better yet, you can even use any pushbutton you already have in your project that you want to debounce, and pass it to the Encoder library even if that button is not physically attached to the Encoder. By calling encoder.button() you will still get the debouncing effect applied to that button. Maybe that's also useful for you in case you have a button with critical operation that needs to operate in a 'clean' way.
Hey John!
Is it possible to use this library with encoders that don't have pushbuttons? Or if I have encoders that have pushbuttons but don't want to use them in my project, is there any way I can utilize your wonderful library while leaving the pushbutton pins not connected to the board?
It looks like no matter what I need to pass three variables for pin locations in while creating a new Encoder object, so I'm assuming if I just pass in the pins A and B then that won't work...is there perhaps any way I can pass in a null value for the pushbutton pin and still get everything to compile?
The reason I'm not connecting push buttons is to save digital pin space...I've got an Arduino Micro and I'm trying to hook up 5 encoders along with some other switches so all of my digital pins are basically taken up. I may be able to move the switches onto some analog pins and make that work but still, if I can use your library and get away without the pushbuttons I'd love that!
I've tried several other encoder library solutions and none seem to be giving me the result I need so I'd like to give yours a go!
I'm still pretty fresh with Arduino programming so forgive me if this is an easy issue to solve.
Thanks!
Stan
The text was updated successfully, but these errors were encountered: