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

◆ loop()

void loop ( )

Definition at line 56 of file ColorTemperature.ino.

57{
58 // draw a generic, no-name rainbow
59 static uint8_t starthue = 0;
60 fill_rainbow( leds + 5, NUM_LEDS - 5, --starthue, 20);
61
62 // Choose which 'color temperature' profile to enable.
63 uint8_t secs = (millis() / 1000) % (DISPLAYTIME * 2);
64 if( secs < DISPLAYTIME) {
65 FastLED.setTemperature( TEMPERATURE_1 ); // first temperature
66 leds[0] = TEMPERATURE_1; // show indicator pixel
67 } else {
68 FastLED.setTemperature( TEMPERATURE_2 ); // second temperature
69 leds[0] = TEMPERATURE_2; // show indicator pixel
70 }
71
72 // Black out the LEDs for a few secnds between color changes
73 // to let the eyes and brains adjust
74 if( (secs % DISPLAYTIME) < BLACKTIME) {
75 memset8( leds, 0, NUM_LEDS * sizeof(CRGB));
76 }
77
78 FastLED.show();
79 FastLED.delay(8);
80}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
#define NUM_LEDS
Definition Apa102.ino:6
#define TEMPERATURE_1
#define TEMPERATURE_2
#define BLACKTIME
#define DISPLAYTIME
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:58
void fill_rainbow(struct CRGB *targetArray, int numToFill, uint8_t initialhue, uint8_t deltahue)
Fill a range of LEDs with a rainbow of colors.
void * memset8(void *ptr, uint8_t value, uint16_t num)
Faster alternative to memset() on AVR.
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:54

References BLACKTIME, DISPLAYTIME, FastLED, fill_rainbow(), leds, memset8(), NUM_LEDS, TEMPERATURE_1, and TEMPERATURE_2.

+ Here is the call graph for this function: