FastLED 3.9.15
Loading...
Searching...
No Matches
EspI2SDemo.ino
Go to the documentation of this file.
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
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
39 // This is a no-op but tests that we have access to gCntBuffer, part of the
40 // i2s api. You can delete this in your own sketch. It's only here for testing
41 // purposes.
42 if (false) {
43 int value = gCntBuffer;
44 value++;
45 }
46}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
#define NUM_LEDS
Definition Apa102.ino:6
void setup()
void loop()
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:58
central include file for FastLED, defines the CFastLED class/object
LED controller for WS2812 LEDs with GRB color order.
Definition FastLED.h:138
@ Red
<div style='background:#FF0000;width:4em;height:4em;'></div>
Definition crgb.h:611
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Definition crgb.h:499
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:54