Created
February 27, 2022 23:01
-
-
Save fredowsley/04b61440680985a31734e965961eb51b to your computer and use it in GitHub Desktop.
FastLED Ukraine flag static
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() { | |
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