Closed shupershuff closed 2 years ago
There is nothing in the code to prevent usage of >10 GPIO inputs. The only exception is availability of GPIO pins (some are reserved). Reorder your GPIOs and observe what happens.
BTW, GPIO16 & GPIO17 are unsuitable on WROVER models.
This is a 38pin WROOM model. I've tested each button successfully, just can't add more than 10 (in any order) in the software. If I do the tenth one saves as pin 0 and the others after it save as -1.
I think I have found the problem.
No, the problem is in the anticipation of the code. JS behaves differntly than C/C++.
Is this something that will need fixing in the next release do you think?
Possible fix pushed to my fork. Will need to test it though.
What happened?
Currently when specifying more than 10 buttons, WLED only allows you to configure pins for the first 10 (0 through to 9). Setting additional pins reverts back to -1, except for button 10 which gets set to 0.
When compiling, I'm using the build flag -D WLED_MAX_BUTTONS=14 I'm using a 38pin ESP32. In PIO the board type I'm using is "board = esp-wrover-kit". Whilst I don't know C++ I can vaguely read the config files and I haven't found anything obvious that's setting a button limit of 10.
"Why so many buttons?" The reason for so many buttons is that I'm making a physical controller with 2 digital joysticks, each of which have 7 digital buttons (left, right ,up, down, Middle (joystick press), set & reset).
To Reproduce Bug
As per the above, simply adding more than 10 buttons and trying to set the pins for anything past Button 9 fails.
Expected Behavior
Would expect that you could set as many pins as an ESP32 would allow for.
Install Method
Self-Compiled
What version of WLED?
0.13.0-b5 build 2111190
Which microcontroller/board are you seeing the problem on?
ESP32
Relevant log/trace output
No response
Anything else?
No response
Code of Conduct