I'm having some Gemma issues. The code is linked below.

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).


I wish I could help you😺

Is it crashing or are you getting into a state where you are stuck with both hue and level variance being stuck at 0?

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?

Here’s the thread regarding the issue I was having. I learned that: “coin cells dont like draws of over ~5mA…the efficiency plummets as the mA goes up”

So, in effect, if your project is drawing more than 5mA, you might see this, which is why under certain circumstances, it could totally be just fine.

I ended up switching to a (150mah) lipo, which works really well. Try testing it with USB or something else and see if it works. Good luck!

That’s awesome feedback. I didn’t know about the current limit issues. I
may order a LiPo now and see what happens.

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).