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

◆ XY()

uint16_t XY ( uint8_t x,
uint8_t y )
Examples
Noise.ino, NoisePlusPalette.ino, SmartMatrix.ino, and XYMatrix.ino.

Definition at line 210 of file Fire2023.ino.

210 {
211 // any out of bounds address maps to the first hidden pixel
212 // https://macetech.github.io/FastLED-XY-Map-Generator/
213 if ( (x >= WIDTH) || (y >= HEIGHT) ) {
214 return (LAST_VISIBLE_LED + 1);
215 }
216 const uint8_t XYTable[] = {
217 25, 26, 81, 82,
218 25, 27, 81, 83,
219 25, 28, 80, 84,
220 24, 29, 79, 85,
221 23, 30, 78, 86,
222 22, 31, 77, 87,
223 21, 32, 76, 88,
224 20, 33, 75, 89,
225 19, 34, 74, 90,
226 18, 35, 73, 91,
227 17, 36, 72, 92,
228 16, 37, 71, 93,
229 15, 38, 70, 94,
230 14, 39, 69, 95,
231 13, 40, 68, 96,
232 12, 41, 67, 97,
233 11, 42, 66, 98,
234 10, 43, 65, 99,
235 9, 44, 64, 100,
236 8, 45, 63, 101,
237 7, 46, 62, 102,
238 6, 47, 61, 103,
239 5, 48, 60, 104,
240 4, 49, 59, 105,
241 3, 50, 58, 106,
242 2, 51, 57, 107,
243 1, 52, 56, 108,
244 0, 53, 55, 109
245 };
246
247 uint8_t i = (y * WIDTH) + x;
248 uint8_t j = XYTable[i];
249 return j;
250}
int y
Definition Audio.ino:72
#define WIDTH
Definition Audio.ino:33
int x
Definition Audio.ino:71
#define HEIGHT
Definition Audio.ino:32
#define LAST_VISIBLE_LED
Definition Fire2023.ino:38

References HEIGHT, LAST_VISIBLE_LED, WIDTH, x, and y.