Can anybody tell me why this function dies out after about 20 minutes?

fastled-support
gplus
(John D) #1

Can anybody tell me why this function dies out after about 20 minutes? It works fine, and then will freeze and turn off.

https://pastebin.com/dg2uAwu2

(Chris Parton) #2

Hi @John_D , idex is probably overflowing to a negative number, which is returning a negative number when you use it in the modulus operation. Try making idex an unsigned integer?

(Andrew Tuline) #3

Further to that, I’d be making everything unsigned.

(John D) #4

@Chris_Parton Thank you! That did the trick!

(Chris Parton) #5

@John_D No problem, glad I could help :slight_smile: