It's hard to say without seeing a picture of your setup or at least a schematic.
But you can turn on an internal pull-up resistor. In your setup, after you turn the pin to an Input, use digitalWrite(19, HIGH); and that will enable the internal pullup.
Now it comes on when I put my hand near the board and turns off when I move it away. :-? It doesn't matter if 19 is grounded or not, same behavior.
I just have a 10-segment display hooked to pins 2-11 (which I was using for a tracer, which worked just fine), and seeing that the impedance is so high for the pins, I'm just shorting 19 to ground.
While we are happy that you have it working, it would have been nice to let us (and future searchers) what was wrong and how you fixed it. It might help someone who comes after you.
That is selfish of me, I'm sorry.
Well, like the "Button" page says, the input will float all over unless you nail it directly to ground with a 10k pull-down resister. Then you just feed your input 5v to make it go high. The resistor keeps the 5v from shorting directly to ground.
One typical noobish brain toot after another. I just wasn't getting it until I found that particular page.
I would think that directly connecting 2 pins like this was not safe unless there was a resistor between them. Maybe there are internal resistors that limit current enough?
I would think that directly connecting 2 pins like this was not safe unless there was a resistor between them. Maybe there are internal resistors that limit current enough?
Well the only way it would be unsafe is if one made a programing error where both pins were set to output mode and then set to opposite logic level states. A 200 ohm resistor between the pins would protect against that kind of brain fart.