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

◆ loop()

void loop ( )

Definition at line 30 of file Cylon.ino.

30 {
31 static uint8_t hue = 0;
32 Serial.print("x");
33 // First slide the led in one direction
34 for(int i = 0; i < NUM_LEDS; i++) {
35 // Set the i'th led to red
36 leds[i] = CHSV(hue++, 255, 255);
37 // Show the leds
38 FastLED.show();
39 // now that we've shown the leds, reset the i'th led to black
40 // leds[i] = CRGB::Black;
41 fadeall();
42 // Wait a little bit before we loop around and do it again
43 delay(10);
44 }
45 Serial.print("x");
46
47 // Now go in the other direction.
48 for(int i = (NUM_LEDS)-1; i >= 0; i--) {
49 // Set the i'th led to red
50 leds[i] = CHSV(hue++, 255, 255);
51 // Show the leds
52 FastLED.show();
53 // now that we've shown the leds, reset the i'th led to black
54 // leds[i] = CRGB::Black;
55 fadeall();
56 // Wait a little bit before we loop around and do it again
57 delay(10);
58 }
59}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
#define NUM_LEDS
Definition Apa102.ino:6
void fadeall()
Definition Cylon.ino:28
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: