Generalized FastLED strip parameters

This commit is contained in:
David Madison 2016-12-21 11:29:46 -05:00
parent 3a9b6157d0
commit 4cf7d401e3
1 changed files with 7 additions and 3 deletions

View File

@ -1,8 +1,6 @@
// Slightly modified Adalight protocol implementation that uses FastLED // Slightly modified Adalight protocol implementation that uses FastLED
// library (http://fastled.io) for driving WS2811/WS2812 led strip // library (http://fastled.io) for driving WS2811/WS2812 led strip
#include <FastLED.h>
// -------------------------------------------------------------------- // --------------------------------------------------------------------
// -- General Settings // -- General Settings
@ -10,6 +8,10 @@
#define LED_PIN 6 // Arduino data output pin #define LED_PIN 6 // Arduino data output pin
#define BRIGHTNESS 255 // maximum brightness #define BRIGHTNESS 255 // maximum brightness
// --- FastLED Setings
#define LED_TYPE WS2812B // led strip type for FastLED
#define COLOR_ORDER GRB // color order for bitbang
// --- Serial Settings // --- Serial Settings
#define SPEED 115200 // serial port speed, max available #define SPEED 115200 // serial port speed, max available
static const unsigned long // time before LEDs are shut off, if no data static const unsigned long // time before LEDs are shut off, if no data
@ -21,6 +23,8 @@ static const unsigned long // time before LEDs are shut off, if no data
// -------------------------------------------------------------------- // --------------------------------------------------------------------
#include <FastLED.h>
CRGB leds[NUM_LEDS]; CRGB leds[NUM_LEDS];
uint8_t * ledsRaw = (uint8_t *)leds; uint8_t * ledsRaw = (uint8_t *)leds;
@ -53,7 +57,7 @@ void setup()
digitalWrite(GROUND_PIN, LOW); digitalWrite(GROUND_PIN, LOW);
#endif #endif
FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS); FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS);
// Dirty trick: the circular buffer for serial data is 256 bytes, // Dirty trick: the circular buffer for serial data is 256 bytes,
// and the "in" and "out" indices are unsigned 8-bit types -- this // and the "in" and "out" indices are unsigned 8-bit types -- this