Adafruit 8x8 LED matrix. More compact code?
Re: Adafruit 8x8 LED matrix. More compact code?
Just swap x and y, I guess?
Re: Adafruit 8x8 LED matrix. More compact code?
Yes, good suggestion. Instead of this:
I did this
and it is now the same orientation as the other device.
Thanks.
Code: Select all
for y, line in enumerate(image):
for x in range(8):
if line & (1 << x):
display.pixel(x, y, 1)
display.show()
I did this
Code: Select all
for y, line in enumerate(image):
for x in range(8):
if line & (1 << x):
display.pixel(y, x, 1)
display.show()
Thanks.