I have a QtPy ESP32-S2 powered by USB, running CircuitPython. It hosts a single web page that allows setting the red, green, blue, and white values for a 12V RGBW strip. The pins A0 - A3 send PWM signals to MOSFETs (datasheet) that control the LED strip. The problem happens on boot or reset the LEDs are on at a blinding full blast until it hits the line of code that sets them to 0. I have tried using a relay on the 12V power supply but that only works on the first boot, every time that I hit save in the Mu editor it resets and blinds me. I have tried all the other pins and they all have the same behavior. Any software solutions would have the same effect. I have had the suggestion of using a resistor and capacitor with the 12V source but that would be similar to the relay in that it would only work the first time and also figuring out the exact values would be difficult. I have also had the suggestion of using a "RS flip-flop/latch" but I have never used that before so I'm unfamiliar with how to setup something like that on my breadboard. There is always a last resort option of a physical switch on the 12V supply but I'd like to avoid that if possible.
Here is my circuitpython code for the ESP32: https://github.com/dieseltravis/circuitpython-projects/blob/main/esp-leds/code.py#L9