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

◆ rotate()

void rotate ( CRGB * array,
int length,
uint8_t amount )

Helper: Rotate array elements.

Definition at line 164 of file Parallel_IO.ino.

164 {
165 amount = amount % length; // Handle wrap-around
166 if (amount == 0) return;
167
168 CRGB temp[amount];
169
170 // Copy last 'amount' elements to temp
171 for (int i = 0; i < amount; i++) {
172 temp[i] = array[length - amount + i];
173 }
174
175 // Shift remaining elements right
176 for (int i = length - 1; i >= amount; i--) {
177 array[i] = array[i - amount];
178 }
179
180 // Copy temp to beginning
181 for (int i = 0; i < amount; i++) {
182 array[i] = temp[i];
183 }
184}
fl::UISlider length("Length", 1.0f, 0.0f, 1.0f, 0.01f)
fl::CRGB CRGB
Definition crgb.h:25

References length().

Referenced by loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: