wallart

8x8 pixel display firmware
git clone https://git.woozle.org/neale/wallart.git

Neale Pickett  ·  2023-01-06

xlat.py

 1def xlat(width, pos):
 2    if width == 0:
 3        return pos
 4
 5    x = pos % width
 6    y = pos // width
 7    odd = y % 2
 8
 9    return (y*width) + ((width-x-1)*odd) + (x*(1-odd))
10
11for i in range(32):
12    print(i, xlat(8, i))