Skip to content

Instantly share code, notes, and snippets.

@fredowsley
Created February 27, 2022 23:42
Show Gist options
  • Save fredowsley/7a68c5dfd123f8f2762de866d76b1c56 to your computer and use it in GitHub Desktop.
Save fredowsley/7a68c5dfd123f8f2762de866d76b1c56 to your computer and use it in GitHub Desktop.
FastLED Ukraine Flag Chaser
#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