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

◆ loop()

void loop ( )

Definition at line 75 of file Apa102HD.ino.

75 {
76 // Draw a a linear ramp of brightnesses to showcase the difference between
77 // the HD and non-HD mode.
78 for (int i = 0; i < NUM_LEDS; i++) {
79 uint8_t brightness = map(i, 0, NUM_LEDS - 1, 0, 255);
80 CRGB c(brightness, brightness, brightness); // Just make a shade of white.
81 leds_hd[i] = c; // The APA102HD leds do their own gamma correction.
82 CRGB c_gamma_corrected = software_gamma(c);
83 leds[i] = c_gamma_corrected; // Set the software gamma corrected
84 // values to the other strip.
85 }
86 FastLED.show(); // All leds are now written out.
87 delay(8); // Wait 8 milliseconds until the next frame.
88}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
#define NUM_LEDS
Definition Apa102.ino:6
CRGB software_gamma(const CRGB &in)
Definition Apa102HD.ino:50
CRGB leds_hd[NUM_LEDS]
Definition Apa102HD.ino:44
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:58
UISlider brightness("Brightness", 255, 0, 255, 1)
long map(long x, long in_min, long in_max, long out_min, long out_max)
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:54

References brightness, FastLED, leds, leds_hd, NUM_LEDS, and software_gamma().

+ Here is the call graph for this function: