It works for me as is, however I noticed that you don’t have any Serial.println statements in there. Whenever I’m debugging code, they’re all over the place, and often find the stupidest of errors on my part.
In addition, I made the following changes (not that it didn’t already work):
#define brightnessInPin A0 // I prefer this #define MIN_BRIGHTNESS 5 // 20 isn’t all the dull
Of course, I added Serial.begin(57600); in setup()
Thank you Marc Miller and Andrew Tuline. I found the problem: Broken cable feeding the A0 pin. Replaced and almost all is well. The only thing is that this display will NOT dim to zero. When I go to the lowest setting on the pot there is still a faint glow emiting from the LED’s.
@Freddie_Olivas Are you still using constrain? If so, even if your MIN_BRIGHTNESS is set to 0, if your pot is reading something slightly above 0 for some reason then that’s what will get passed to setBrightness.
I must be an idiot but I don’t know what 0xffffff means as in the above statement:
fill_solid(leds,NUM_LEDS,0xffffff);
Can someone enlighten me please?
It’s probably just formatting you haven’t seen before @Freddie_Olivas . That’s a color specified as a Hex value.
You could set the color Blue for example using any of these formats:
leds[i] = CRGB::Blue;
leds[i] = CRGB(0,0,255);
leds[i] = CHSV(160,255,255);
leds[i] = 0x0000FF;