FastLED 3.9.15
Loading...
Searching...
No Matches

◆ setup()

void setup ( )

Definition at line 72 of file FxSdCard.ino.

72 {
73 Serial.begin(115200);
74 Serial.println("Sketch setup");
75 if (!filesystem.beginSd(CHIP_SELECT_PIN)) {
76 Serial.println("Failed to initialize file system.");
77 }
78
79 // Note that data/ is a special directory used by our wasm compiler. Any data
80 // is placed in it will be included in the files.json file which the browser will
81 // use to stream the file asynchroniously in during the runtime. For a real sd card
82 // just place all this in the /data/ directory of the SD card to get matching
83 // behavior.
84 video = filesystem.openVideo("data/video.rgb", NUM_LEDS, FPS, 2);
85 if (!video) {
86 FASTLED_WARN("Failed to instantiate video");
87 gError = true;
88 return;
89 }
90 video2 = filesystem.openVideo("data/color_line_bubbles.rgb", NUM_LEDS, FPS, 2);
91 if (!video2) {
92 FASTLED_WARN("Failed to instantiate video2");
93 gError = true;
94 return;
95 }
97 bool ok = filesystem.readScreenMap("data/screenmap.json", "strip1", &screenMap);
98 if (!ok) {
99 Serial.println("Failed to read screen map");
100 gError = true;
101 return;
102 }
103
105 .setCorrection(TypicalLEDStrip)
106 .setScreenMap(screenMap);
107 FastLED.setBrightness(96);
108 Serial.println("FastLED setup done");
109}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
#define NUM_LEDS
Definition Apa102.ino:6
#define COLOR_ORDER
#define LED_TYPE
#define LED_PIN
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:58
ScreenMap screenMap
Definition FxSdCard.ino:60
bool gError
Definition FxSdCard.ino:70
Video video2
Definition FxSdCard.ino:64
#define CHIP_SELECT_PIN
Definition FxSdCard.ino:42
FileSystem filesystem
Definition FxSdCard.ino:62
#define FPS
Definition FxSdCard.ino:41
Video video
Definition FxSdCard.ino:63
@ TypicalLEDStrip
Typical values for SMD5050 LEDs.
Definition color.h:19
#define FASTLED_WARN
Definition warn.h:7

References CHIP_SELECT_PIN, COLOR_ORDER, FastLED, FASTLED_WARN, filesystem, FPS, gError, LED_PIN, LED_TYPE, leds, NUM_LEDS, screenMap, TypicalLEDStrip, video, and video2.