i think i understand, could you help me with the code?
youve been a great help so far
really is appreciated
just tried this, i dont get errors but cant turn the gpio to true
youve been a great help so far
really is appreciated
just tried this, i dont get errors but cant turn the gpio to true
class Lightcontrol(MenuOption): """Control; Lights""" def __init__(self): self.last = self.millis() MenuOption.__init__(self) def redraw(self, menu): menu.write_row(1,"Turn Lights On?") if nav.BUTTON - self.last < 1000 * 5: return False a = handle_on(self) def handle_On(self): GPIO.output(13,0) GPIO.output(5,0) GPIO.output(13,1) return print('ON! Doing monkey stuff!') time.sleep(2) print('Done monkey stuff!') def handle_Off(): GPIO.output(5,0) GPIO.output(13,0) GPIO.output(5,1) print("OFF! Doing donkey stuff!") time.sleep(2) print("Done donkey stuff!") """ Using a set of nested lists you can describe the menu you want to display on dot3k. Instances of classes derived from MenuOption can be used as menu items to show information or change settings. See GraphTemp, GraphCPU, Contrast and Backlight for examples. """ LC = Lightcontrol() menu = Menu( structure={ 'Power Options': { 'Reboot':GraphSysReboot(), 'Shutdown':GraphSysShutdown(), }, 'Aquarium': { 'Lighting': { 'Control': { 'On': LC, } } }, 'Clock': Clock(backlight), 'Status': { 'IP': IPAddress(), 'CPU': GraphCPU(backlight), 'Temp': GraphTemp() }, 'Settings': { 'Display': { 'Contrast': Contrast(lcd), 'Backlight': Backlight(backlight) } } }, lcd=lcd, idle_handler=Lightcontrol, idle_timeout=30, input_handler=Text()) """ You can use anything to control dot3k.menu, but you'll probably want to use dot3k.touch """ nav.bind_defaults(menu) while 1: menu.redraw() time.sleep(0.05)