LED swirl effect

Basically, I am bad at coding with Arduino and need some help with making a swirl effect to continuously go through a strip of LEDs. Here is what I have so far:

CRGBArray<NUM_LEDS> leds;
int INpin = 7;
int input = 0;

void setup()
{
FastLED.addLeds<NEOPIXEL,A0>(leds, NUM_LEDS);
pinMode(INpin, INPUT);
}
void loop() {

input=digitalRead(INpin);
if (input > 0) {
for(int i = 0; i <= NUM_LEDS; i++)
{ leds[i] = CRGB::Blue;
FastLED.show();
leds[i ] = CRGB::Black;
delay(50);
}
}
}

Like this:

CRGBArray<NUM_LEDS> leds;
int INpin = 7;
int input = 0;

void setup() 
{ 
FastLED.addLeds<NEOPIXEL,A0>(leds, NUM_LEDS); 
pinMode(INpin, INPUT);
}
 void loop() {
  
input=digitalRead(INpin);
if (input > 0) { 
for(int i = 0; i <= NUM_LEDS; i++)   
 {   leds[i] = CRGB::Blue;
     FastLED.show();
     leds[i ] = CRGB::Black;   
     delay(50);   
 }
}   
    }

Help would be greatly appreciated!

This is considered "Does not name a type".
`CRGBArray<NUM_LEDS> leds;

Thanks for your immediate response!

Here is a full error summary, I believe it all derives from the root error though:

sketch_LEDbeta:1:1: error: 'CRGBArray' does not name a type
CRGBArray<NUM_LEDS> leds;
^~~~~~~~~
/Users/28zwartwe/Documents/Arduino/sketch_LEDbeta/sketch_LEDbeta.ino: In function 'void setup()':
sketch_LEDbeta:7:1: error: 'FastLED' was not declared in this scope
FastLED.addLeds<NEOPIXEL,A0>(leds, NUM_LEDS);
^~~~~~~
sketch_LEDbeta:7:17: error: 'NEOPIXEL' was not declared in this scope
FastLED.addLeds<NEOPIXEL,A0>(leds, NUM_LEDS);
^~~~~~~~
sketch_LEDbeta:7:30: error: 'leds' was not declared in this scope
FastLED.addLeds<NEOPIXEL,A0>(leds, NUM_LEDS);
^~~~
/Users/28zwartwe/Documents/Arduino/sketch_LEDbeta/sketch_LEDbeta.ino:7:30: note: suggested alternative: 'gets'
FastLED.addLeds<NEOPIXEL,A0>(leds, NUM_LEDS);
^~~~
gets
sketch_LEDbeta:7:36: error: 'NUM_LEDS' was not declared in this scope
FastLED.addLeds<NEOPIXEL,A0>(leds, NUM_LEDS);
^~~~~~~~
/Users/28zwartwe/Documents/Arduino/sketch_LEDbeta/sketch_LEDbeta.ino: In function 'void loop()':
sketch_LEDbeta:14:21: error: 'NUM_LEDS' was not declared in this scope
for(int i = 0; i <= NUM_LEDS; i++)
^~~~~~~~
sketch_LEDbeta:15:6: error: 'leds' was not declared in this scope
{ leds[i] = CRGB::Blue;
^~~~
/Users/28zwartwe/Documents/Arduino/sketch_LEDbeta/sketch_LEDbeta.ino:15:6: note: suggested alternative: 'gets'
{ leds[i] = CRGB::Blue;
^~~~
gets
sketch_LEDbeta:15:16: error: 'CRGB' has not been declared
{ leds[i] = CRGB::Blue;
^~~~
sketch_LEDbeta:16:6: error: 'FastLED' was not declared in this scope
FastLED.show();
^~~~~~~
sketch_LEDbeta:17:17: error: 'CRGB' has not been declared
leds[i ] = CRGB::Black;
^~~~
exit status 1
'CRGBArray' does not name a type

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

i need the pic

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.