Toggle Navigation
Hatchery
Eggs
Flipdotprototype
__init__.py
Users
Badges
Login
Register
MCH2022 badge?
go to mch2022.badge.team
__init__.py
raw
Content
import badge import ugfx from machine import I2C, Pin import time i2c = I2C( sda=Pin(26), scl=Pin(27), freq=1000000 ) ugfx.init() ugfx.clear( ugfx.WHITE ) ugfx.flush() for i in range(16): i2c.writeto_mem(0x60, 0x07+(i*4), b'\x00') i2c.writeto_mem(0x40, 0x07+(i*4), b'\x00') i2c.writeto_mem(0x61, 0x07+(i*4), b'\x00') for i in range(100): i2c.writeto_mem(0x40, 0x27, b'\x10') i2c.writeto_mem(0x40, 0x29, b'\x00') i2c.writeto_mem(0x60, 0x07, b'\x10') i2c.writeto_mem(0x60, 0x09, b'\x00') time.sleep_ms(5) i2c.writeto_mem(0x40, 0x27, b'\x00') i2c.writeto_mem(0x40, 0x29, b'\x10') i2c.writeto_mem(0x60, 0x07, b'\x00') i2c.writeto_mem(0x60, 0x09, b'\x10') time.sleep_ms(1000) i2c.writeto_mem(0x40, 0x07, b'\x10') i2c.writeto_mem(0x40, 0x09, b'\x00') i2c.writeto_mem(0x60, 0x27, b'\x10') i2c.writeto_mem(0x60, 0x29, b'\x00') time.sleep_ms(5) i2c.writeto_mem(0x40, 0x07, b'\x00') i2c.writeto_mem(0x40, 0x09, b'\x10') i2c.writeto_mem(0x60, 0x27, b'\x00') i2c.writeto_mem(0x60, 0x29, b'\x10') time.sleep_ms(1000)