FastLED 3.9.3
Loading...
Searching...
No Matches
OctoWS2811Demo.ino
Go to the documentation of this file.
1
4
5#define USE_OCTOWS2811
6#include <OctoWS2811.h>
7#include <FastLED.h>
8
9#define NUM_LEDS_PER_STRIP 64
10#define NUM_STRIPS 8
11
12CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
13
14// Pin layouts on the teensy 3:
15// OctoWS2811: 2,14,7,8,6,20,21,5
16
17void setup() {
18 FastLED.addLeds<OCTOWS2811>(leds, NUM_LEDS_PER_STRIP);
20}
21
22void loop() {
23 static uint8_t hue = 0;
24 for(int i = 0; i < NUM_STRIPS; i++) {
25 for(int j = 0; j < NUM_LEDS_PER_STRIP; j++) {
26 leds[(i*NUM_LEDS_PER_STRIP) + j] = CHSV((32*i) + hue+j,192,255);
27 }
28 }
29
30 // Set the first n leds on each strip to show which strip it is
31 for(int i = 0; i < NUM_STRIPS; i++) {
32 for(int j = 0; j <= i; j++) {
33 leds[(i*NUM_LEDS_PER_STRIP) + j] = CRGB::Red;
34 }
35 }
36
37 hue++;
38
39 FastLED.show();
40 FastLED.delay(10);
41}
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:33
central include file for FastLED, defines the CFastLED class/object
void delay(unsigned long ms)
Delay for the given number of milliseconds.
Definition FastLED.cpp:178
void setBrightness(uint8_t scale)
Set the global brightness scaling.
Definition FastLED.h:722
void show(uint8_t scale)
Update all our controllers with the current led colors, using the passed in brightness.
Definition FastLED.cpp:82
static CLEDController & addLeds(CLEDController *pLed, struct CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0)
Add a CLEDController instance to the world.
Definition FastLED.cpp:67
@ Red
Definition crgb.h:591
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Definition chsv.h:11
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:39