Toggle Navigation
Hatchery
Eggs
boom-countdown
__init__.py
Users
Badges
Login
Register
MCH2022 badge?
go to mch2022.badge.team
__init__.py
raw
Content
from time import sleep #import esp #import badge import ugfx #badge.init() ugfx.init() #ugfx.input_init() ugfx.clear(ugfx.BLACK) ugfx.flush() ugfx.clear(ugfx.WHITE) ugfx.flush() button_pressed = False def run(): """ x = 1000 while (not button_pressed) | (x > 0): ugfx.clear(ugfx.WHITE) ugfx.string_box(0,10,296,26, str(x), "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) ugfx.flush() sleep(1) x -=1 ugfx.clear(ugfx.WHITE) if not button_pressed: ugfx.string_box(0,10,296,26, "BOOM", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) else: ugfx.string_box(0,10,296,26, "Bom Gestopt", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) ugfx.flush() sleep(10000) """ def press_button(): global button_pressed button_pressed = True #ugfx.input_attach(ugfx.BTN_A, press_button) run()