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

◆ XY()

uint16_t XY ( uint8_t x,
uint8_t y )

Definition at line 26 of file SmartMatrixSketch.h.

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

References kMatrixSerpentineLayout, kMatrixWidth, x, and y.

Referenced by loop().

+ Here is the caller graph for this function: