Toggle Navigation
Hatchery
Eggs
LED Rainbow
__init__.py
Users
Badges
Login
Register
MCH2022 badge?
go to mch2022.badge.team
__init__.py
raw
Content
import badge import ugfx import time from random import randint, random import sys badge.init() ugfx.init() ugfx.input_init() badge.leds_init() badge.leds_enable() ugfx.set_lut(ugfx.LUT_NORMAL) ugfx.clear(ugfx.WHITE) ugfx.string(140, 75, "LED Rainbow","Roboto_BlackItalic24", ugfx.BLACK) ugfx.flush() leds_array = bytes(24) while True: badge.leds_send_data(leds_array) time.sleep(0.1) leds_array = leds_array[4:] + bytes([randint(128, 255), randint(0, 255), randint(0, 128), 0]) badge.leds_send_data(leds_array) time.sleep(0.1) leds_array = leds_array[4:] + bytes([randint(0, 128), randint(0, 255), randint(128, 255), 0])