Created
November 18, 2014 08:54
-
-
Save OrganicIrradiation/f2754cffb04d07bab929 to your computer and use it in GitHub Desktop.
Arduino FastLED WS2812B red tail light sequence
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" | |
// For led chips like Neopixels, which have a data line, ground, and power, you just | |
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock, | |
// ground, and power), like the LPD8806, define both DATA_PIN and CLOCK_PIN | |
#define LED_PIN 11 | |
#define COLOR_ORDER GRB | |
#define CHIPSET WS2812B | |
#define NUM_LEDS 72 | |
// Define the array of leds | |
CRGB leds[NUM_LEDS]; | |
void setup() { | |
FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip ); | |
} | |
void loop() { | |
uint8_t val = random(10); | |
leds[val] = CHSV(0, 255, random(255)); | |
FastLED.show(); | |
leds[val] = CHSV(0, 255, 0); | |
delay(10); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment