Toggle Navigation
Hatchery
Eggs
R-buzzer
__init__.py
Users
Badges
Login
Register
MCH2022 badge?
go to mch2022.badge.team
__init__.py
raw
Content
import badge import ugfx import deepsleep def draw_text(): ugfx.clear(ugfx.WHITE) ugfx.string(20, 20, "Buzzer test", "PermanentMarker22", ugfx.BLACK) ugfx.string(20, 60, "A: buzzzz", "Roboto_Regular12", ugfx.BLACK) ugfx.string(20, 80, "B: back to home", "Roboto_Regular12", ugfx.BLACK) ugfx.flush() def buzzzz(pressed): if pressed: badge.vibrator_activate(0xFF) def home(pressed): if pressed: deepsleep.reboot() ugfx.init() ugfx.input_init() badge.vibrator_init() draw_text() ugfx.input_attach(ugfx.BTN_A, buzzzz) ugfx.input_attach(ugfx.BTN_B, home)