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

◆ XY()

uint16_t XY ( uint8_t x,
uint8_t y )

Definition at line 24 of file SmartMatrixSketch.h.

25{
26 uint16_t i;
27
28 if( kMatrixSerpentineLayout == false) {
29 i = (y * kMatrixWidth) + x;
30 }
31
32 if( kMatrixSerpentineLayout == true) {
33 if( y & 0x01) {
34 // Odd rows run backwards
35 uint8_t reverseX = (kMatrixWidth - 1) - x;
36 i = (y * kMatrixWidth) + reverseX;
37 } else {
38 // Even rows run forwards
39 i = (y * kMatrixWidth) + x;
40 }
41 }
42
43 return i;
44}
int y
Definition simple.h:93
int x
Definition simple.h:92
#define kMatrixSerpentineLayout
#define kMatrixWidth

References kMatrixSerpentineLayout, kMatrixWidth, x, and y.

Referenced by loop().

+ Here is the caller graph for this function: