Last active
December 31, 2021 12:24
-
-
Save kennycoder/08487586ed39bfec305dd4fe412f15c1 to your computer and use it in GitHub Desktop.
GCP logo LED strip
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 38 | |
#define DATA_PIN 3 | |
CRGB leds[NUM_LEDS]; | |
void setup() { | |
delay(2000); | |
FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS); | |
pinMode(LED_BUILTIN, OUTPUT); | |
} | |
void loop() { | |
for (int i = 0; i < 7; i++) { | |
leds[i] = CRGB ( 255, 255, 0); | |
FastLED.show(); | |
} | |
for (int i = 7; i < 12; i++) { | |
leds[i] = CRGB ( 0, 255, 0); | |
FastLED.show(); | |
} | |
for (int i = 12; i < 23; i++) { | |
leds[i] = CRGB ( 0, 0, 255); | |
FastLED.show(); | |
} | |
for (int i = 23; i < 31; i++) { | |
leds[i] = CRGB ( 255, 0, 0); | |
FastLED.show(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment