Skip to content

Instantly share code, notes, and snippets.

@fredowsley
Created February 27, 2022 23:01
Show Gist options
  • Save fredowsley/04b61440680985a31734e965961eb51b to your computer and use it in GitHub Desktop.
Save fredowsley/04b61440680985a31734e965961eb51b to your computer and use it in GitHub Desktop.
FastLED Ukraine flag static
#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() {
for(int i = 0; i < mid; i++ ) {
leds[i] = CRGB::Yellow;
}
FastLED.show();
delay(500);
for(int i = mid; i < NUM_LEDS; i++ ) {
leds[i] = CRGB::Blue;
}
FastLED.show();
delay(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment