-
Notifications
You must be signed in to change notification settings - Fork 3
LEDS RGB
MarcG edited this page Feb 22, 2015
·
3 revisions
- El led: https://www.adafruit.com/datasheets/WS2812B.pdf
- El drier (incorporado en el led): http://www.adafruit.com/datasheets/WS2811.pdf
- NeoPixel from adafruit: https://github.com/adafruit/Adafruit_NeoPixel
- FastLED: https://github.com/FastLED/FastLED
Drivers soportados por FastLed:
- TM1829
- TM1809
- TM1804
- TM1803
- UCS1903
- UCS1903B
- WS2812
- WS2812B
- WS2811
- APA104
- WS2811_400
- GW6205
- GW6205_400
- LPD1886
#include <FastLED.h>
#define LED_PIN 1 // which pin your pixels are connected to
#define NUM_LEDS 78 // how many LEDs you have
#define BRIGHTNESS 200 // 0-255, higher number is brighter.
#define COLOR_ORDER GRB // Try mixing up the letters (RGB, GBR, BRG, etc) for a whole new world of color combinations
CRGB leds[NUM_LEDS];
int ledMode = 0;
void setup() {
delay( 2000 ); // power-up safety delay
FastLED.addLeds<WS2812B, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
FastLED.setBrightness(BRIGHTNESS);
}
void loop() {
leds[0] = CRGB::Blue;
leds[1] = CHSV( HUE_BLUE, 255, 100);
leds[2] = CRGB( 0, 0, 255);
leds[3] = CRGB::Red;
leds[4] = CHSV( HUE_RED, 255, 100);
leds[5] = CRGB( 255, 0, 0);
FastLED.show();
}
