MCPcopy Create free account
hub / github.com/FastLED/FastLED / XY

Function XY

examples/Fire2023/Fire2023.h:219–259  ·  view source on GitHub ↗

Physical layout of LED strip ****************************/

Source from the content-addressed store, hash-verified

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

Callers 1

Fire2023Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected