Controlling LED and Button with single pin I am trying to use an ATTINY85/Ardunio Uno to turn an LED on and listen to a button input. I don't mind if the LED turns on when the button is used. 

I am have found this thread from a couple of years ago however it doesn't seem to work at low voltage (3V) due ending up with floating pins due to the forward voltage of the LED. I was wondering if anyone had a soltion or if they could check to see if my solution would be suitable.

Many Thanks







simulate this circuit &ndash; Schematic created using CircuitLab
I think this is what you want...







simulate this circuit &ndash; Schematic created using CircuitLab

To check for button, set pin to INPUT and enable pullup. If pin is LOW, then the button is pushed.

To light LED, set pin to OUTPUT and LOW.