I made some effects for neopixel. I defined them as classes with a tick method so I can easily switch them from the main loop. When I create two of these effect classes (doesn’t matter if it is the same) the thing crashes on the D1 Mini while working perfectly on the Arduino UNO.
This is my code:
The only effects that are in the correct format are rainbow and strobo.
I am really confused about this and would appreciate any help.
Can you insert some Serial.println() in setup() and loop() in the main.cpp file to see if setup() is even reached, or at which line it approximately crashes?
Then the constructor code of a globally constructed object is crashing it before it can do anything.
Or something is so wrong with the board that no firmware can boot at all. Have you tried the linked WiFiScan.ino example?
The two classes and constructors where you copy the entire Adafruit_NeoPixel object by value instead of storing a pointer to it seem extremely suspicious to me (e.g this). Can you change that to a pointer reference?
It works when I create only one of the effects so the ESP works. I tried using pointers and references, both resulted in all leds flashing randomly (even when creating just one instance of an effect). I have no idea why.