Thundercat
Well-known member
Hi all,
I've got a sketch with 4 buttons. All using the same button code.
3 of them behave perfectly, but the 4th constantly outputs "high," as if I'm holding down the button, and measuring with a meter shows it's putting out 3.3v.
My first thought is, it's a hardware issue. Button is damage; or I got the wiring wrong or something.
So I stripped down the sketch to bare bones, and the button behaves perfectly, only going high when I press it, and low when I release it.
I feel like I'm losing my mind here, but doesn't that prove this is not a hardware problem, if a bare ones sketch works perfectly?
Thing is, I cannot find anything at all in the longer sketch that would cause the pin to read high, continuously. It's as if the button is held in, and it will not respond to button presses to go low/high; it just stays high.
Again, the other 3 buttons, using the same code, work perfectly in the longer sketch.
Posting the longer sketch is an issue because it's 30K lines, but can anyone think of something that would cause a pin to be held high continuously, besides the obvious digitalwrite command which I am not using? It's an input pin.
Thanks,
Mike
EDIT: I should add, I've got external pull-down resistors on all pins. Enabling/disabling internal pull-downs/ups has no effect on the outcome.
I've got a sketch with 4 buttons. All using the same button code.
3 of them behave perfectly, but the 4th constantly outputs "high," as if I'm holding down the button, and measuring with a meter shows it's putting out 3.3v.
My first thought is, it's a hardware issue. Button is damage; or I got the wiring wrong or something.
So I stripped down the sketch to bare bones, and the button behaves perfectly, only going high when I press it, and low when I release it.
I feel like I'm losing my mind here, but doesn't that prove this is not a hardware problem, if a bare ones sketch works perfectly?
Thing is, I cannot find anything at all in the longer sketch that would cause the pin to read high, continuously. It's as if the button is held in, and it will not respond to button presses to go low/high; it just stays high.
Again, the other 3 buttons, using the same code, work perfectly in the longer sketch.
Posting the longer sketch is an issue because it's 30K lines, but can anyone think of something that would cause a pin to be held high continuously, besides the obvious digitalwrite command which I am not using? It's an input pin.
Thanks,
Mike
EDIT: I should add, I've got external pull-down resistors on all pins. Enabling/disabling internal pull-downs/ups has no effect on the outcome.