FastLED 3.9.12
Loading...
Searching...
No Matches
EspI2SDemo.ino
1// Simple test for the I2S on the ESP32dev board.
2// IMPORTANT:
3// This is using examples is built on esp-idf 4.x. This existed prior to Arduino Core 3.0.0.
4// To use this example, you MUST downgrade to Arduino Core < 3.0.0
5// or it won't work on Arduino.
6
7
8#define FASTLED_ESP32_I2S
9#include <FastLED.h>
10
11// How many leds in your strip?
12#define NUM_LEDS 1
13
14// For led chips like WS2812, which have a data line, ground, and power, you just
15// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
16// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
17// Clock pin only needed for SPI based chipsets when not using hardware SPI
18#define DATA_PIN 3
19
20// Define the array of leds
21CRGB leds[NUM_LEDS];
22
23void setup() {
24 // Uncomment/edit one of the following lines for your leds arrangement.
25 // ## Clockless types ##
26 FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS); // GRB ordering is assumed
27}
28
29void loop() {
30 // Turn the LED on, then pause
31 leds[0] = CRGB::Red;
32 FastLED.show();
33 delay(500);
34 // Now turn the LED off, then pause
35 leds[0] = CRGB::Black;
36 FastLED.show();
37 delay(500);
38}
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