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

◆ xy_serpentine()

FASTLED_FORCE_INLINE uint16_t fl::xy_serpentine ( uint16_t x,
uint16_t y,
uint16_t width,
uint16_t height )

Definition at line 17 of file xymap.h.

18 {
19 (void)height;
20 if (y & 1) // Even or odd row?
21 // reverse every second line for a serpentine lled layout
22 return (y + 1) * width - 1 - x;
23 else
24 return y * width + x;
25}
int y
Definition Audio.ino:72
int x
Definition Audio.ino:71

References FASTLED_FORCE_INLINE, x, and y.

Referenced by fl::XYMap::mapToIndex().

+ Here is the caller graph for this function: