I’m having some Gemma issues. The code is linked below. Basically that program runs perfectly on an Uno for days. The exact same code on the Gemma locks up solid after about an hour, but it seems to be random. Anyway you cut it, on the Gemma, it won’t run for very long, and makes it sorta useless. I want the Gemma because I’m sticking a single Neopixel in a small lantern with two 2032 batteries. I don’t have room for much else. And I’m not convinced the Trinket would be different in this case (it would fit).
It’s a Gemma, so I can’t actually tell. My assumption is that it’s all getting stuck at 0, and I hoped to prove that with the Uno with some print output, but it won’t die. Still running, at 13 hours now. I had a build running debug to see what the values are, then I just ran the same non print code just to be sure, and that ran for about 12 hours on the Uno.
When it does die, it’s stuck at HUE_RED at least. It could be a variance of 250, but it’s harder to tell that much. It also takes a bit of work to get it running again. Several reboots the last time I caught it. That made me wonder if it was my LED array growing somehow out of bounds. I don’t have a lot of space left if it did grow, and it would explain the behavior as well.
This is also repeatable on 4 different Gemmas, same code, same result.
Have you tested the Gemma with another power source? I ran into an issue last year with my Gemma & 7 neopixels on 2xcr2032’s where after ~30 minutes, they would all go red. I’m still new to this but it’s worth a shot. Try another power source to see if it’s the Gemma or batteries.
I haven’t run it on USB power yet for that length of time, but that’s a good suggestion. I had hoped that 2x2032 at 3.3v would last more than 30 - 60 minutes. Although, to be fair, I flipped one on last night to show to my wife and it ran for the entire length of the Cubs game, or about 3 hours.
Any thoughts on other ways to power this using a very small power source?
Anyone try wireless power for something like this?
Something else that you might want to try is investigating what kind of low power modes you can get with the AVR - for example, instead of delaying for 5ms at a time, you could go into one of the various sleep states. Of course, you’d still have the power draw of the led (obviously, lower brightness there would also help).