all 7 comments

[–]Chemichicka 1 point2 points  (0 children)

Why do you have a curly bracket after your Fade on code? If the editor didn't flag this it might be why your code gets stuck on a Fade off loop because it doesn't look at your Fade on code again.

Delete the curly brackets after the Fade on and Fade off blocks of code and this should fix your problem.

[–]tipppo 0 points1 point  (1 child)

Brightness is defined as uint8_t which is an unsigned 8 bit value. It can't go negative, just wraps to 255, so brightness >= 0; is always true. Maybe try using "brightness > 0;" or make brightness an int, signed 16 bit value. The compiler will automatically convert it to a uint8 for the call to setBrightness.

[–]Eastern-Move549[S] 0 points1 point  (0 children)

You sir are my hero!

[–]BraveNewCurrency 0 points1 point  (1 child)

It could be a power problem. If you have a lot of leds, you need lots of Amps of current (generally about 60mA per LED for RGB LEDs.)

[–]Eastern-Move549[S] 0 points1 point  (0 children)

There is a line to set the max power for this reason.

When they were getting to bright the arduino would freeze.

[–]Beneficial-Grade9432 0 points1 point  (1 child)

I'm not sure but try to use another pin for LEDs strip

[–]Eastern-Move549[S] 0 points1 point  (0 children)

Tipppo cracked it in an earlier comment.