Toggle Navigation
Hatchery
Eggs
Pride Flags
__init__.py
Users
Badges
Login
Register
__init__.py
raw
Content
import display import buttons import mch22 def rainbowflag(): display.drawRect(0,0,320,40,True,0xf54242) display.drawRect(0,40,320,80,True,0xf5a742) display.drawRect(0,80,320,120,True,0xf5ec42) display.drawRect(0,120,320,160,True,0x57f542) display.drawRect(0,160,320,200,True,0x4299f5) display.drawRect(0,200,320,240,True,0x8442f5) display.flush() def transflag(): display.drawRect(0,0,320,48,True,0x8fc5ff) display.drawRect(0,48,320,96,True,0xf0b7f7) display.drawRect(0,96,320,144,True,0xffffff) display.drawRect(0,144,320,192,True,0xf0b7f7) display.drawRect(0,192,320,240,True,0x8fc5ff) display.flush() def enbyflag(): display.drawRect(0,0,320,60,True,0xfff200) display.drawRect(0,60,320,120,True,0xffffff) display.drawRect(0,120,320,180,True,0xaa00ff) display.drawRect(0,180,320,240,True,0x000000) display.flush() currentflag = 0 flags = [rainbowflag, transflag, enbyflag] def main(): rainbowflag() buttons.attach(buttons.BTN_RIGHT, nextflag) buttons.attach(buttons.BTN_LEFT, prevflag) buttons.attach(buttons.BTN_HOME,reboot) def nextflag(pressed): global currentflag if pressed: currentflag +=1 if currentflag >= len(flags): currentflag = 0 flag = flags[currentflag] flag() def prevflag(pressed): global currentflag if pressed: currentflag -=1 if currentflag < 0: currentflag = len(flags)-1 flag = flags[currentflag] flag() def reboot(pressed): if pressed: mch22.exit_python() main()