Hi all!
I have a quick question. Can I do analogRead() on an Atmega32u4 digital pin? One that is still attached to the ADC? Like D8 which is ADC11?
Here is an Atmega32u4 pinout diagram:
Thanks in advance!
Yes: IF you use a standard board definition, like Leonardo
Ok, thank you.
I am trying to attach 8 buttons to that one pin on an atmega32u4. Any suggestions on how to do that? I was thinking attach a different size resistor from one side of each button to +5V, and all the second sides of the buttons attached together and to the digital pin. That way you could read a different voltage for each different button that is pressed. FYI, I don't need two buttons to be pressed at one time.
You will also need a resistor between the pin and Ground so the two resistors act as a voltage divider on the 5V supply. I would pick a 10k for the pull-down resistor and values between 1k and about 20k for the pull-up resistors.
Got it. Thanks @johnwasser and @mrburnette!
I would turn the schematic so that +5 is along the top and Ground is along the bottom, as is traditional. ![]()
No need to connect all of the Terminal 4's on the buttons since they are connected to Terminal 3's which are all connected.