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

◆ XY()

uint16_t XY ( uint8_t x,
uint8_t y )

Definition at line 22 of file SmartMatrix.ino.

23{
24 uint16_t i;
25
26 if( kMatrixSerpentineLayout == false) {
27 i = (y * kMatrixWidth) + x;
28 }
29
30 if( kMatrixSerpentineLayout == true) {
31 if( y & 0x01) {
32 // Odd rows run backwards
33 uint8_t reverseX = (kMatrixWidth - 1) - x;
34 i = (y * kMatrixWidth) + reverseX;
35 } else {
36 // Even rows run forwards
37 i = (y * kMatrixWidth) + x;
38 }
39 }
40
41 return i;
42}
uint32_t x[NUM_LAYERS]
Definition Fire2023.ino:80
uint32_t y[NUM_LAYERS]
Definition Fire2023.ino:81
#define kMatrixSerpentineLayout
#define kMatrixWidth

References kMatrixSerpentineLayout, kMatrixWidth, x, and y.