500+ This must be a daytime job
Arduino Boards - Extra Inputs!
Just a quick note regarding Arduino inputs, and microcontroller inputs in general. When you run out of digital inputs, the analog inputs can also be used. You can read simple on/off, but you can also read multiple values for rotary switches (not encoders) and toggle switches. just put some different value resistors on the different switch poles and program the A/D pins to detect those values when sampled. We have used this method for a long time. It can really help when you run out of digital input pins. I have had projects where I had to use a different microcontroller for just 1 more pin!
75+ Posting Member
Re: Arduino Boards - Extra Inputs!
Rotary encoders will work with analog pins but you have to grind (steal and modify) your own code. Haven't managed to get the Rotary and Quadrature2 libraries to work on analog pins using pinMode INPUT and INPUT_PULLUP. You also lose access to interrupts for any code using long delays. Have been able to put one rotary encoder and the built in push button on two analog pins. Tried for one encoder channel and one push buttons on both pins but found I needed a second handling routine for the second push button after moving on to something else.