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

◆ Line()

void Line ( int x0,
int y0,
int x1,
int y1,
byte color )

Definition at line 213 of file funky.cpp.

213 {
214 int dx = abs(x1 - x0), sx = x0 < x1 ? 1 : -1;
215 int dy = -abs(y1 - y0), sy = y0 < y1 ? 1 : -1;
216 int err = dx + dy, e2;
217 for (;;) {
218 leds[XY(x0, y0)] = CHSV(color, 255, 255);
219 if (x0 == x1 && y0 == y1)
220 break;
221 e2 = 2 * err;
222 if (e2 > dy) {
223 err += dy;
224 x0 += sx;
225 }
226 if (e2 < dx) {
227 err += dx;
228 y0 += sy;
229 }
230 }
231}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
int XY(int x, int y)
Definition funky.cpp:190
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Definition chsv.h:16

References leds, and XY().

Referenced by Audio1(), Audio2(), Audio4(), Audio5(), Audio6(), CaleidoTest1(), CaleidoTest2(), CopyTest(), CopyTest2(), MSGEQtest5(), and MSGEQtest6().

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