This works on Arduino nano
#include<FastLED.h>
#define NUM_LEDS 24
#define DATA_PIN 7
#define CLOCK_PIN 5
CRGBArray<NUM_LEDS> leds;
void setup() {
FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN, BGR, DATA_RATE_MHZ(12)>(leds, NUM_LEDS);
}
void loop() {
FastLED.clear();
// Turn the first led red for 1 second
//leds[0] = CRGB::Red;
//leds[1] = CRGB::Green;
//leds[2] = CRGB::Blue;
//FastLED.show();
//delay(1000);
for(int i=0; i<NUM_LEDS; i++){
leds[i].setRGB( 255, 0, 0);
delay(30);
FastLED.show();
}
//FastLED.show();
delay(1000);
for(int i=0; i<NUM_LEDS; i++){
leds[i].setRGB( 0, 255, 0);
}
FastLED.show();
delay(1000);
for(int i=0; i<NUM_LEDS; i++){
leds[i].setRGB( 0, 0, 255);
}
FastLED.show();
delay(1000);
}
