Max inputs of Arduino Uno?

Hi, I understand the Uno has 6 analog in and 14 Digital in.

what I don't understand:

can the analog in be reconfigured as digital in?

can they ALL be configured with internal Pullup?

so 20 Digi in with _Pullup?

thanks in advance
thomas

yes (but not A6 and A7 on Arduino with those pins)

yes (but not A6 and A7 on Arduino with those pins)

but.. D13 usually has a led attached, so there is a resistor that might interfere if you have a normally closed to ground switch relying on the pullup resistor (the LED and series resistor and internal pull-up resistor are acting like a voltage divider).

The version "R3" has a logic gate for the led, so it is a normal digital pin just like the others.

For pin A0...A5, the analog hardware and the digital hardware inside the microcontroller are both connected to the same pin.
If you want you can use them both at the same time. You could, for example, enable the pullup resistor from the digital hardware and read the analog value with the analog hardware.

There are also a number of tricks to do some questionable things with other pins. It depends on the Arduino board what can be done with other pins (such as the AREF, RESET and the pins of the ICSP header). Sometimes pins can be used for multiple things, for example a single pin that controls a led and reads a button.

Okay, thanks a lot!

If you bootload a mega328 with the MiniCore core at 8MHz or lower and use the internal oscillator you have 2 more digital pins available. The crystal oscillator pins (PB6 and PB7) become available as pins 21 and 22.

You could get even more pins with Shift registers or IO expanders