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

◆ loop()

void loop ( )

Definition at line 173 of file curr.h.

173 {
174 uint32_t now = millis();
177
178 static int w = 0;
179
180 EVERY_N_MILLIS(300) {
181 // Update the corkscrew mapping every second
182 w = (w + 1) % CORKSCREW_WIDTH;
183 }
184
185
186 // draw a blue line down the middle
187 for (int i = 0; i < CORKSCREW_HEIGHT; ++i) {
189 frameBuffer.at((w + 1) % CORKSCREW_WIDTH, i) = CRGB::Blue;
191 frameBuffer.at((w + 2) % CORKSCREW_WIDTH, i) = CRGB::Blue;
193 }
194
195
196 // printOutput(corkscrewMap);
197
198 for (int i = 0; i < NUM_LEDS; ++i) {
199 // Get the position in the frame buffer
201 // Draw the tile to the frame buffer
202 CRGB c = frameBuffer.at(pos.x, pos.y);
203 leds[i] = c;
204
205 FASTLED_WARN_IF(i < 16, "LED " << i << " at position: "
206 << pos.x << ", " << pos.y
207 << " with color: " << c);
208
209 }
210
211 FastLED.show();
212}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
#define NUM_LEDS
Definition Apa102.ino:6
uint8_t pos
Definition Blur.ino:11
CFastLED FastLED
Global LED strip management instance.
#define CORKSCREW_HEIGHT
Definition curr.h:43
Corkscrew corkscrew(corkscrewInput)
#define CORKSCREW_WIDTH
Definition curr.h:42
LedsXY< CORKSCREW_WIDTH, CORKSCREW_HEIGHT > frameBuffer
Definition curr.h:171
#define EVERY_N_MILLIS(N)
Checks whether to execute a block of code every N milliseconds.
Definition lib8tion.h:1297
void clear(CRGB(&arr)[N])
Definition clear.h:8
@ Blue
<div style='background:#0000FF;width:4em;height:4em;'></div>
Definition crgb.h:506
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:55
#define FASTLED_WARN_IF
Definition warn.h:8

References CRGB::Blue, fl::clear(), corkscrew(), CORKSCREW_HEIGHT, CORKSCREW_WIDTH, EVERY_N_MILLIS, FastLED, FASTLED_WARN_IF, frameBuffer, leds, NUM_LEDS, and pos.

+ Here is the call graph for this function: