Controlling LED and Button with single pin
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.