Created
February 27, 2022 23:42
-
-
Save fredowsley/7a68c5dfd123f8f2762de866d76b1c56 to your computer and use it in GitHub Desktop.
FastLED Ukraine Flag Chaser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <FastLED.h> | |
#define NUM_LEDS 160 | |
#define DATA_PIN 6 | |
// Define the array of leds | |
CRGB leds[NUM_LEDS]; | |
int mid = NUM_LEDS/2; | |
void setup() { | |
FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS); | |
} | |
void loop() { | |
// Move a single white led | |
for(int iLed = 0; iLed < NUM_LEDS; iLed = iLed + 1) { | |
leds[iLed] = CRGB::Yellow; | |
FastLED.show(); | |
delay(5); | |
} | |
for(int iLed = 0; iLed < NUM_LEDS; iLed = iLed + 1) { | |
leds[iLed] = CRGB::Blue; | |
FastLED.show(); | |
delay(5); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment