Results 1 to 2 of 2
  1. #1
    500+ This must be a daytime job



    Join Date
    Jan 2009
    Location
    Tampa
    Posts
    531
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    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!

    Buddy

  2. #2
    150+ Forum Groupie


    BushPilotWannabe's Avatar
    Join Date
    Jan 2014
    Location
    Alberta, Canada
    Posts
    176
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    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.