The LED strip works just fine controlled from the UI.
But testing the buttons leads to all sorts of squirrely behavior: Only testing single and double clicks, sometimes they work correctly, other times a double click on one button will fire off the single click command of another button, other times it won’t respond. Sometimes a single click will register, start the color change, only to ultimately suddenly behave as if another button were pressed.
Does anyone with electronics experience have a hunch as to what this could be? My ground/GPIO connections all seem solid, but no matter how I rewire nothing seems to improve.
How have you configured the 4 buttons in WLED?
You describe these as “analog arcade buttons”, but your description leads me to believe, they’re just standard push button switches?
If they are, there is no need for pull-up resistors at all, that’s handled internal to the GPIO you select.
At minimum, remove the pull-up(s) and simplify your setup to 1 button at a time until you verify that works.
Then try to add a 2nd and move forward.
“GPIOs 34 to 39 are GPIs – input only pins. These pins don’t have internal pull-up or pull-down resistors. They can’t be used as outputs, so use these pins only as inputs”
So based on that I thought I’d need pullups at least on GPIOs 34-39.
Ok - did some digging through the ESP docs and you are (mostly) absolutely correct - GPIOs 34-39 do not have internal pullup (or pulldown) circuitry. This makes sense as they are allowed to be used as ADC inputs and pullup/down would affect them. So GPIOs 32-33 don’t need pullups, GPI’s 34-39 do.
Having said that, I still believe your switches are digital not analog inputs.
They way you’ve described their connection to GPIO inputs, they will either produce 3.3V via pullup (internal or external) when the button isn’t pressed or 0V when you pressthe button and it shorts the contacts to ground.
That’s the definition of a digital signal, so those switches would be called “pushbuttons” in WLED and treated as digital inputs. Luckily, GPIs 34-39 can be used for digital as well as ADC inputs, so they should still work (???)
If they do give you any grief, there’s no reason you can’t use any of the other (available) GPIOs as inputs, since you just want a standard digital input.
Rewired just two switches (GPIOs 34 and 35) trying to see if bad connections / grounding was the issue. WLED is configured correctly (as PushButton) and I played around with both using/disabling internal pull-up.
The buttons just misbehave – random triggers, generally inconsistent behavior, and sometimes doing things not even called for in the macro setting (had one of the two buttons set to default on/off, but it instead would scroll through FX presets!)
Will come back to it when the urge to hurl it all across the room subsides.
Quick update – not 100% there, but VERY good headway. Genuine thanks for your advice.
Stripped the electronics back to the ESP32 on a breadboard. Added one button at a time and currently have a pair of push buttons configured on new pins (25 and 26 I think) with no pull-up resistors as per our discussion. For the first time, they seem to be behaving normally!
Best I can tell, maybe the perfboard I was using before had some bad cross connections.
I also realized my sloppy terminology was confusing me. I remembered reading a note about only ADC2 pins (34-39) being usable when WiFi is active. At the time I thought this meant push buttons, but I now realize its likely only referring to the use of a potentiometer for brightness control, etc.
So basically, all your advice was correct and thanks for the shove.