FastLED 3.9.3
Loading...
Searching...
No Matches
OctoWS2811.ino
1// BasicTest example to demonstrate how to use FastLED with OctoWS2811
2
3// FastLED does not directly support Teensy 4.x PinList (for any
4// number of pins) but it can be done with edits to FastLED code:
5// https://www.blinkylights.blog/2021/02/03/using-teensy-4-1-with-fastled/
6
7#include <OctoWS2811.h>
8#define USE_OCTOWS2811
9#include <FastLED.h>
10
11#define NUM_LEDS 1920
12
13CRGB leds[NUM_LEDS];
14
15#define RED 0xFF0000
16#define GREEN 0x00FF00
17#define BLUE 0x0000FF
18#define YELLOW 0xFFFF00
19#define PINK 0xFF1088
20#define ORANGE 0xE05800
21#define WHITE 0xFFFFFF
22
23void setup() {
24 Serial.begin(9600);
25 Serial.println("ColorWipe Using FastLED");
26 LEDS.addLeds<OCTOWS2811,GRB>(leds,NUM_LEDS/8);
27 LEDS.setBrightness(60);
28}
29
30void loop() {
31 int microsec = 6000000 / NUM_LEDS;
32 colorWipe(RED, microsec);
33 colorWipe(GREEN, microsec);
34 colorWipe(BLUE, microsec);
35 colorWipe(YELLOW, microsec);
36 colorWipe(PINK, microsec);
37 colorWipe(ORANGE, microsec);
38 colorWipe(WHITE, microsec);
39}
40
41void colorWipe(int color, int wait)
42{
43 for (int i=0; i < NUM_LEDS; i++) {
44 leds[i] = color;
45 FastLED.show();
46 delayMicroseconds(wait);
47 }
48}
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:33
central include file for FastLED, defines the CFastLED class/object
void show(uint8_t scale)
Update all our controllers with the current led colors, using the passed in brightness.
Definition FastLED.cpp:82
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:39