Skip to content

Instantly share code, notes, and snippets.

@kennycoder
Last active December 31, 2021 12:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennycoder/08487586ed39bfec305dd4fe412f15c1 to your computer and use it in GitHub Desktop.
Save kennycoder/08487586ed39bfec305dd4fe412f15c1 to your computer and use it in GitHub Desktop.
GCP logo LED strip
#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