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

◆ loop()

void loop ( )

Definition at line 31 of file Cylon.ino.

31 {
32 static uint8_t hue = 0;
33 Serial.print("x");
34 // First slide the led in one direction
35 for(int i = 0; i < NUM_LEDS; i++) {
36 // Set the i'th led to red
37 leds[i] = CHSV(hue++, 255, 255);
38 // Show the leds
39 FastLED.show();
40 // now that we've shown the leds, reset the i'th led to black
41 // leds[i] = CRGB::Black;
42 fadeall();
43 // Wait a little bit before we loop around and do it again
44 delay(10);
45 }
46 Serial.print("x");
47
48 // Now go in the other direction.
49 for(int i = (NUM_LEDS)-1; i >= 0; i--) {
50 // Set the i'th led to red
51 leds[i] = CHSV(hue++, 255, 255);
52 // Show the leds
53 FastLED.show();
54 // now that we've shown the leds, reset the i'th led to black
55 // leds[i] = CRGB::Black;
56 fadeall();
57 // Wait a little bit before we loop around and do it again
58 delay(10);
59 }
60}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
#define NUM_LEDS
Definition Apa102.ino:6
void fadeall()
Definition Cylon.ino:29
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:58
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Definition chsv.h:16

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

+ Here is the call graph for this function: