Toggle Navigation
Hatchery
Eggs
Pocketlight
__init__.py
Users
Badges
Login
Register
MCH2022 badge?
go to mch2022.badge.team
__init__.py
raw
Content
#!/usr/bin/python # -*- coding: utf-8 -*- import keypad, display, random display.drawFill(0xFFFFFF) display.flush() def random_color(): r = lambda : random.randint(0, 255) return '0x%02X%02X%02X' % (r(), r(), r()) def on_key(key_index, pressed): if(pressed): color = random_color() display.drawFill(int(color)) display.flush() keypad.add_handler(on_key)