FastLED 3.10.8
Loading...
Searching...
No Matches

◆ XY()

uint16_t XY ( uint8_t x,
uint8_t y )

Definition at line 37 of file Noise.ino.

38{
39 uint16_t i;
40
41 if( kMatrixSerpentineLayout == false) {
42 i = (y * kMatrixWidth) + x;
43 }
44
45 if( kMatrixSerpentineLayout == true) {
46 if( y & 0x01) {
47 // Odd rows run backwards
48 uint8_t reverseX = (kMatrixWidth - 1) - x;
49 i = (y * kMatrixWidth) + reverseX;
50 } else {
51 // Even rows run forwards
52 i = (y * kMatrixWidth) + x;
53 }
54 }
55
56 return i;
57}
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.