Connecting a switch to an analog pin

the internal pull-up resistors r 20kOhm (min.) to 50kOhm (max.) according to the datasheet for the 168...
btw: the arduino reference says 20K...
i dont know the typical value... and the datasheet is blank at that place... ::slight_smile:

luckily that switch has 3 pins, so that we dont need any pull-up...
just during the transition there might be some noise, which might need software or hardware (a 100nF capacitor?) attention...

and we can use a digital pin, because there r just 2 conditions possible...
that is an advantage, because digital pins can be read faster...

so i would recommend the following "circuit":
GND ---- switch pin1
5V ---- switch pin2
arduino input pin ---- switch pin3 (---- tiny capacitor ---- GND)

BUT: dont connect GND directly to the input pin by accident, because that would cause a short circuit, if the switch is (not(?)) pressed...