from time import ticks_ms import math from machine import RTC import hub75 # from font_8x12 import font, letter_width, letter_height from font_10x14 import font, letter_width, letter_height WIDTH, HEIGHT = 128, 64 rtc = RTC() hub = hub75.Hub75(WIDTH, HEIGHT, stb_invert=True) hub.start() hub.clear() t_s = ticks_ms() f_s = ticks_ms() / 1000.0 frames = 0 def scroll_text(text, y, t): text_length = len(text) x = int(t) letter = int((x / letter_width) % text_length) pixel = x % letter_width char = ord(text[letter]) for s_x in range(WIDTH): col = font[char - 32][pixel] s_y = y + int(math.sin((t / 3.0) + s_x / 30.0) * 8)
from time import ticks_ms import math from machine import RTC WIDTH, HEIGHT = 64, 32 MAX_DIST = (WIDTH * WIDTH + HEIGHT * HEIGHT) * 0.5 DIGITS = [0b1110111, 0b0100100, 0b1011101, 0b1101101, 0b0101110, 0b1101011, 0b1111010, 0b0100101, 0b1111111, 0b0101111] ox = 32 oy = 16 hue = 0 rtc = RTC() hub = hub75.Hub75(WIDTH, HEIGHT, stb_invert=False) hub.start() hub.clear() set_hsv = hub.set_hsv set_rgb = hub.set_rgb def dot(x, y, h, s, v): set_hsv(x, y, h, s, v) set_hsv(x + 1, y, h, s, v) set_hsv(x, y + 1, h, s, v) set_hsv(x + 1, y + 1, h, s, v) def shader_fg(x, y):
import hub75 import time WIDTH, HEIGHT = 64, 64 hub = hub75.Hub75(WIDTH, HEIGHT, panel_type=hub75.PANEL_FM6126A) 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)
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)