FastLED 3.10.6
Loading...
Searching...
No Matches
MultipleEsp32SpiBuses.ino
Go to the documentation of this file.
1// @filter: (platform is esp32)
8
9#include <FastLED.h>
10
11// The @filter above keeps discovery-driven builds from picking this sketch up
12// off ESP32 at all. The guard below is the belt to that suspenders: an explicit
13// `uno all` compiles every sketch regardless of filter, and an ESP32-only
14// sketch has to compile away to nothing there rather than `#error` out, or the
15// build reports what looks like a toolchain problem rather than an example that
16// was never meant for AVR.
17#if defined(ESP32)
18
19CRGB spi2Leds[8];
20CRGB spi3Leds[8];
21
22void setup() {
23 FastLED.addLeds<APA102, 11, 12, RGB, DATA_RATE_MHZ(20)>(
24 spi2Leds, 8, fl::Esp32SpiBus::HOST2);
25 FastLED.addLeds<APA102, 13, 14, RGB, DATA_RATE_MHZ(20)>(
26 spi3Leds, 8, fl::Esp32SpiBus::HOST3);
27}
28
29void loop() {
30 FastLED.show();
31}
32
33#else
34void setup() {}
35void loop() {}
36#endif // defined(ESP32)
void setup()
void loop()
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
constexpr EOrder RGB
Definition eorder.h:17
@ APA102
APA102 LED chipset.
Definition FastLED.h:304
#define DATA_RATE_MHZ
Definition fastspi.h:95
fl::CRGB CRGB
Definition crgb.h:25