FastLED 3.9.15
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages

◆ operator[]()

CLEDController & CFastLED::operator[] ( int x)

Get a reference to a registered controller.

Returns
a reference to the Nth controller

Definition at line 165 of file FastLED.cpp.

165 {
166 CLEDController *pCur = CLEDController::head();
167 while(x-- && pCur) {
168 pCur = pCur->next();
169 }
170 if(pCur == NULL) {
171 return *(CLEDController::head());
172 } else {
173 return *pCur;
174 }
175}
uint32_t x[NUM_LAYERS]
Definition Fire2023.ino:80
CLEDController * next()
Get the next controller in the linked list after this one.
static CLEDController * head()
Get the first LED controller in the linked list of controllers.

References CLEDController::head(), CLEDController::next(), and x.

+ Here is the call graph for this function: