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

◆ loop()

void loop ( )

Definition at line 29 of file Cylon.ino.

29 {
30 static uint8_t hue = 0;
31 Serial.print("x");
32 // First slide the led in one direction
33 for(int i = 0; i < NUM_LEDS; i++) {
34 // Set the i'th led to red
35 leds[i] = CHSV(hue++, 255, 255);
36 // Show the leds
37 FastLED.show();
38 // now that we've shown the leds, reset the i'th led to black
39 // leds[i] = CRGB::Black;
40 fadeall();
41 // Wait a little bit before we loop around and do it again
42 delay(10);
43 }
44 Serial.print("x");
45
46 // Now go in the other direction.
47 for(int i = (NUM_LEDS)-1; i >= 0; i--) {
48 // Set the i'th led to red
49 leds[i] = CHSV(hue++, 255, 255);
50 // Show the leds
51 FastLED.show();
52 // now that we've shown the leds, reset the i'th led to black
53 // leds[i] = CRGB::Black;
54 fadeall();
55 // Wait a little bit before we loop around and do it again
56 delay(10);
57 }
58}
#define NUM_LEDS
fl::CRGB leds[NUM_LEDS]
void fadeall()
Definition Cylon.ino:27
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
uint8_t hue
Definition advanced.h:94
fl::hsv8 CHSV
Definition chsv.h:11
void delay(u32 ms, bool run_async=true) FL_NOEXCEPT
Public delay wrapper that keeps bare Arduino delay() preferred after using fl::delay; while still all...
Definition delay.h:98
unsigned char uint8_t
Definition s16x16x4.h:209
#define Serial
Definition serial.h:304

References fadeall(), FastLED, hue, leds, NUM_LEDS, and Serial.

+ Here is the call graph for this function: