Skip to content
MarcG edited this page Feb 22, 2015 · 3 revisions

LEDS RGB (ws2812):

Hardware:

Librerias:

Drivers soportados por FastLed:

  • TM1829
  • TM1809
  • TM1804
  • TM1803
  • UCS1903
  • UCS1903B
  • WS2812
  • WS2812B
  • WS2811
  • APA104
  • WS2811_400
  • GW6205
  • GW6205_400
  • LPD1886

How to connect?

Schem leds

#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();
}

Que significa RGB y HSV?

RGB HSV

Ejercicios:

Efecto el coche fantastico:

Solución

Hacer un arco-iris con los leds:

Solución

Pong 1D

Solución

Ejercicios usando el Encoder y los Leds:

HOME

  • [Instalación y familiarización con el IDE] (Instalación y familiarización con el IDE)
  • [Bases de C] (Bases de C)
  • [Ejercicios] (Ejercicios)
  • [Programación de la Matriz de LEDs] (Programación de la Matriz de LEDs)

Clone this wiki locally