Uing the fllowing pins with a button with an incorporated led?

  • R7-12 are needed when the Arduino a GPIO pin is HIGH (LED OFF).
    If the switch was pressed, pin is made GND, shorting the HIGH 5v to GND. R7-12 limits current.

  • I use very HIGH efficiency LEDs, the resistor values are selected so the LED intensity are balanced.
    Blue and white LEDs light if you sneeze on them :wink:

  • If the GPIO pin is output and at a HIGH (LED is OFF), closing the switch does not turn ON the LED.
    When GPIO is made input (to read the switch) and the switch is closed, the LED goes on for the read time, for about 8.6us, every 50ms (very dim).

2 Likes