Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uint8_t XY (uint8_t x, uint8_t y) {
- // any out of bounds address maps to the first hidden pixel
- if ( (x >= LED_X) || (y >= LED_Y) ) {
- return (LAST_VISIBLE_LED + 1);
- }
- const uint8_t XYTable[] = {
- 7, 8, 23, 24,
- 6, 9, 22, 25,
- 5, 10, 21, 26,
- 4, 11, 20, 27,
- 3, 12, 19, 28,
- 2, 13, 18, 29,
- 1, 14, 17, 30,
- 0, 15, 16, 31
- };
- uint8_t i = (y * LED_X) + x;
- uint8_t j = XYTable[i];
- return j;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement