Input Question

slipstick:
Isn't pin 10 the output pin with the LED connected to it? You can't do input and output on the same pin. Or did you mean something else?

I think the problem is in your basic description. You don't pass 5V from the input pin to the output pin to light the LED. They are completely separate. You read the value of the input pin (which may be high or low) and then in the code you make a decision based on that value whether to set the output pin high (5V) or low (0V) to light the LED or not.

Steve

Yep, thats what I meant to describe - newby for ya! I only mentioned the output as pin 10, it could be any of the pins really. I had read on an independent site that you risked damaging the board if you used an outside voltage to do the switching, but I can't work out why, after all there is no difference reading 5v from the board to a pin or 5v from off the board . Or am I wrong?