Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <FastLED.h>
- #define NUM_LEDS 16
- #define DATA_PIN 24
- CRGB leds[NUM_LEDS];
- int i;
- void setup() {
- FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
- }
- void loop() {
- for (i=0;i<16;i++){
- leds[i] = CRGB::Red;
- FastLED.show(); delay(50);
- }
- for (i=0;i<16;i++){
- leds[i] = CRGB::Green;
- FastLED.show(); delay(50);
- }
- for (i=0;i<16;i++){
- leds[i] = CRGB::Blue;
- FastLED.show(); delay(50);
- }
- for (i=0;i<16;i++){
- leds[i] = CRGB::Yellow;
- FastLED.show(); delay(50);
- }
- for (i=0;i<16;i++){
- leds[i] = CRGB::White;
- FastLED.show(); delay(50);
- }
- for (i=0;i<16;i++){
- leds[i] = CRGB::Black;
- FastLED.show();delay(50);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement