Toggle Navigation
Hatchery
Eggs
wrd
__init__.py
Login
Register
__init__.py
Content
import easydraw, system, badge, ugfx, sys def action_exit(pushed): if (pushed): # to turn off all the leds at ones badge.led(6,0,0,0) # go back to the home screen system.home() def show_names(x=10, y=10, font='PermanentMarker36', color=ugfx.BLACK): badge.init() nick = badge.nvs_get_str('owner', 'name', 'WRD') width = ugfx.get_string_width(nick, font) ugfx.string(int((128 - width)/2), y, nick, font, color) ugfx.flush() badge.led(1,1,0,1) badge.led(0,1,0,1) badge.led(2,1,1,1) badge.led(3,0,0,1) badge.led(4,1,0,1) badge.led(5,1,0,1) def main(): ugfx.input_init() ugfx.input_attach(ugfx.BTN_B, action_exit) ugfx.input_attach(ugfx.BTN_START, action_exit) show_names() sys.stdin.read(1) #Wait for any key action_exit(True) main()