I am trying to get my little LED strip to work. With the code below - it works. But, I have magic numbers. So, I created two int variables...
My code below works, but I am NOT using the variables, as you can see:
#include "FastLED.h"
int NUM_LEDS = 10;
int STRIP_PIN = 7;
CRGB leds[ 10 ];
void setup() {
FastLED.addLeds<NEOPIXEL, 7>(leds, 10);
}
void loop() {
for(int i = 0; i < 10; i++) {
leds = CRGB::Green;
- FastLED.show();*
- delay(10);*
_ leds = CRGB::Black;_
* FastLED.show();*
* delay(10);*
* }*
}
As soon as I set the line "CRGB leds[ 10 ];"
to
CRGB leds[ NUM_LEDS ];
I get a compiler error:
sketch_may19a:6:21: error: array bound is not an integer constant before ']' token
CRGB leds[ NUM_LEDS ];
I'm unsure why I am getting this and how I should be doing it.
My board is a Arduino Nano (Old Bootloader)