LED and switch on same I/O pin

PaulRB:
Simply connect the led + series resistor between 5V and the Arduino pin. Place the button between the Arduino pin and ground. When the button is pressed, current will flow and the led will light, and the Arduino pin will be pulled to ground. When the button is not pressed, the Arduino pin will be pulled to 5V. A very very tiny current will flow into the Arduino pin, not enough to light the led.

If you want the led to extinguish when the button is pressed, use a push-to-break button.

This seems so simple, I am wondering if I understood your question.

thanks. what about for a momentary switch?