I’m using a button on an IO pin to trigger an effect in my pattern.
When I read the HIGH/LOW (1/0) off the pin, I’ve noticed when the circuit is open, the reading oscillates quickly between 1 and 0, while the closed reading is a constant 1. That can lead to false reads on the 1. I can solve this by using a normally closed button and watching for a zero (although it seems to introduce a small delay while it waits for the zero oscillation) but it completely rules out using a normally open button because it sends false 1s. I’d prefer to use the normally open button if I can. Did I wire something wrong? The circuit looks like this: 3v3 → button → IO17 (currently, though I’ve tried other pins and get the same result — also have tried different NO buttons to the same effect). Anyone have any ideas?
Ok, just answered my own question. I needed to be using the INPUT_PULLUP / INPUT_PULLDOWN pin modes. You learn something new every day!
2 Likes