Calling FastLED.show() sometimes causes reboots…
I have an animation program you can find here: https://pastebin.com/ZUpbWwAa
This is to feed a snowflake with 145 neopixels. The arduino waits for a command from the serial port to run an animation. Each command is 6 bytes.
If you care, 1st byte is the address, 2nd byte is the animation I’m asking for, 3rd byte is how long I want the animation to run for, 4th through 6th are parameters for the animation (starting color perhaps, and so on)
So, if I send the command to do a starburst affect (0x06 0x02 0x08 0x00 0x38 0x02), this works fine. The fourth byte (0x00 in the above example) is which hue to start with (assumed full sat, etc…). I wanted to be able to have a white starburst as well so I made a cheat for it where if someone sends a hue of 0x01, it actually gives a white starburst.
Finally, the last byte of the command (0x02 here) is the type of fade. 0 means no fade at all between frames, 1 means there is fading but there will still be something left at the end of the animation and 2 means there is fading and the star will be pretty much black at the end of the animation.
The problem is when I ask for a white star with no fading. If I do that, the arduino resets itself. If I blank out the FastLED.show line on line 327, no more reboots. I can’t figure it out.
Sorry this is so complicated. I’ve got a bunch of arduinos in my christmas show and the snowflake is a new feature for next Christmas , so there’s timing stuff in there as well that looks a little complicated. Oh, and I store geometry information about the star in eeprom to save space.
Finally, I’m not a good coder, just a hacker so be gentle.