-
I'm seeing some weird behavior with settings that are persisting across reboots... I'm doing a demo setup where I have three different ws2812 strips connected to three different pins. I want to be able to use them one at a time by defining whichever pin I want to use after a reset. What is happening is weird. If I start with power on, the first string that I connect to works correctly. My code then resets the ESP32, creates a NeoPixelBus on a different pin. It will now send output to the new pin and the pin from the previous time. Then I do the same thing with the third pin, and I get the same output running on 3 pins. It seems likely that something isn't getting reset at the ESP32 level. Any thoughts? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Which "method" are you using? How do you create it and destroy it? The ESP32 has a hardware pin muxer (means it will assign pin/pins to hardware) and it sounds like these are not being reset by ESP32 when it reboots. |
Beta Was this translation helpful? Give feedback.
-
Note, I created an issue to track adding the demux of the pin when the NeoPixelBus gets destructed; so all you should have to worry about is destructing the object and it gets handled for you. |
Beta Was this translation helpful? Give feedback.
Which "method" are you using? How do you create it and destroy it?
The ESP32 has a hardware pin muxer (means it will assign pin/pins to hardware) and it sounds like these are not being reset by ESP32 when it reboots.
UPDATE: If this is the case, I can add code to the destructors to turn off the pin mux that is used; but again, you need to make sure to destruct the NeoPixelBus before you reset the device. If you can't control the reset timing, then you need to add code to your setup/startup to demux the last used pin before using a new pin.