FastLED 3.9.7
Loading...
Searching...
No Matches
EspI2SDemo.ino
1
2
3#include <FastLED.h>
4
5// How many leds in your strip?
6#define NUM_LEDS 1
7
8// For led chips like WS2812, which have a data line, ground, and power, you just
9// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
10// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
11// Clock pin only needed for SPI based chipsets when not using hardware SPI
12#define DATA_PIN 3
13
14// Define the array of leds
15CRGB leds[NUM_LEDS];
16
17void setup() {
18 // Uncomment/edit one of the following lines for your leds arrangement.
19 // ## Clockless types ##
20 FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS); // GRB ordering is assumed
21}
22
23void loop() {
24 // Turn the LED on, then pause
25 leds[0] = CRGB::Red;
26 FastLED.show();
27 delay(500);
28 // Now turn the LED off, then pause
29 leds[0] = CRGB::Black;
30 FastLED.show();
31 delay(500);
32}
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:45
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:94
static CLEDController & addLeds(CLEDController *pLed, struct CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0)
Add a CLEDController instance to the world.
Definition FastLED.cpp:79
LED controller for WS2812 LEDs with GRB color order.
Definition FastLED.h:135
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:54
@ Red
Definition crgb.h:608
@ Black
Definition crgb.h:496