pimoroni-pico/micropython/examples/interstate75/i75_32x32_generic.py

24 wiersze
513 B
Python

import hub75
import time
WIDTH, HEIGHT = 32, 32
hub = hub75.Hub75(WIDTH, HEIGHT, panel_type=hub75.PANEL_GENERIC)
hub.start()
hub.clear()
hub.flip()
while True:
h = time.ticks_ms() / 5000.0
hub.set_all_hsv(h, 1.0, 1.0)
for y in range(8):
for x in range(WIDTH):
c = int(x * 255 / WIDTH)
hub.set_rgb(x, y, c, c, c)
for x in range(WIDTH):
hub.set_rgb(x, x, 255, 0, 0)
hub.set_rgb(WIDTH - 1 - x, x, 255, 0, 0)
hub.flip()
time.sleep(1.0 / 60)