def main(): ntptime.settime() matrix = ht1632c.HT1632C() while True: matrix.fill(ht1632c.BLACK) text = '{0:02}{1:02}'.format(*utime.localtime()[3:5]) matrix.text(text, 0, 4, ht1632c.GREEN) matrix.show() utime.sleep_ms(10000)
ROTENC_PIN_0 = 3 ROTENC_PIN_1 = 4 ROTENC_PIN_BTN = 2 BLACK = 0 GREEN = 1 RED = 2 ORANGE = 3 TRANSPARENT = 0xff print "init rotenc" r = rotenc.RotEnc(ROTENC_PIN_0, ROTENC_PIN_1, ROTENC_PIN_BTN, rtcallback) print "init ht1632c" h = ht1632c.HT1632C(NUM_PANELS, PANEL_ROTATION) h.pwm(7) color = GREEN for i in range(0, 480): j = (i + 1) % 160 if j == 0: color += 1 h.clear() h.putstr(32 - j, 0, "Hello there", h.font12x16, color, TRANSPARENT) h.sendframe() time.sleep(50 / 1000.0) print "all led's in black and end" h.box(0, 0, WIDTH - 1, HEIGHT - 1, BLACK)