Toggle Navigation
Hatchery
Eggs
Pride Flags
__init__.py
Users
Badges
Login
Register
MCH2022 badge?
go to mch2022.badge.team
__init__.py
raw
Content
""" Pride flags Display the different pride flags that are part of the pride module. Use left and right to switch the flags. """ import pride import buttons import utime flags = list(pride.flags.keys()) current_flag = 0 pride.show_display(flag=flags[current_flag]) while True: utime.sleep(0.1) pressed = buttons.read( buttons.BOTTOM_LEFT | buttons.BOTTOM_RIGHT ) if pressed & buttons.BOTTOM_RIGHT != 0: current_flag = (current_flag + 1) % len(flags) pride.show_display(flag=flags[current_flag]) if pressed & buttons.BOTTOM_LEFT != 0: current_flag = (current_flag - 1) % len(flags) pride.show_display(flag=flags[current_flag]) utime.sleep(0.1)