FastLED 3.10.8
Loading...
Searching...
No Matches

◆ clear()

void fl::FastLEDAdapter::clear ( bool writeToStrip = false)
overridevirtual

Clear all LEDs (set to black)

Parameters
writeToStripIf true, immediately write to strip (call show())

Implements fl::IFastLED.

Definition at line 60 of file adapter.cpp.hpp.

60 {
63 if (!leds) {
64 return;
65 }
66
67 if (mHasSegment) {
68 // Clear only the segment
69 for (size_t i = mSegmentStart; i < mSegmentEnd; i++) {
70 leds[i] = CRGB::Black;
71 }
72 } else {
73 // Clear all LEDs
74 size_t numLeds = controller.size();
75 for (size_t i = 0; i < numLeds; i++) {
76 leds[i] = CRGB::Black;
77 }
78 }
79
80 if (writeToStrip) {
81 FastLED.show();
82 }
83}
CRGB leds[1]
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
CLEDController * controller
void show(fl::u8 scale) FL_NO_EXCEPT
Update all our controllers with the current led colors, using the passed in brightness.
VIRTUAL_IF_NOT_AVR int size() const FL_NO_EXCEPT
How many LEDs does this controller manage?
CRGB * leds() FL_NO_EXCEPT
Pointer to the CRGB array for this controller.
size_t mSegmentEnd
Definition adapter.h:72
size_t mSegmentStart
Definition adapter.h:71
fl::CLEDController CLEDController
fl::CRGB CRGB
Definition video.h:18
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Definition crgb.h:517

References fl::CRGB::Black, controller, FastLED, fl::FL_NO_EXCEPT, leds, mControllerIndex, mHasSegment, mSegmentEnd, and mSegmentStart.

Referenced by ~FastLEDAdapter().

+ Here is the caller graph for this function: