MCPcopy Create free account
hub / github.com/OpenEPaperLink/OpenEPaperLink / rgbIdleStep

Function rgbIdleStep

ESP32_AP-Flasher/src/leds.cpp:116–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116void rgbIdleStep() {
117 static bool dirUp = true;
118 static uint16_t step = 0;
119
120 if (dirUp) {
121 // up
122 step++;
123 if (step >= rgbIdlePeriod) {
124 dirUp = false;
125 }
126 } else {
127 // down
128 step--;
129 if (step == 0) {
130 dirUp = true;
131 }
132 }
133 CRGB newvalue = blend(CRGB::Black, (const CRGB&)rgbIdleColor, map(step, 0, rgbIdlePeriod, 0, 255));
134 if (newvalue != leds[0]) {
135 leds[0] = newvalue;
136 showRGB();
137 }
138}
139#endif
140
141void setBrightness(int brightness) {

Callers 1

ledTaskFunction · 0.70

Calls 1

showRGBFunction · 0.70

Tested by

no test coverage detected