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. """ backlight_idle = BacklightIdleTimeout(backlight) menu = Menu(structure={ 'WiFi': Wlan(), 'Clock': Clock(backlight), 'Status': { 'IP': IPAddress(), 'CPU': GraphCPU(backlight), 'Temp': GraphTemp() }, 'Settings': { 'Display': { 'Contrast': Contrast(lcd), 'Backlight': Backlight(backlight) } } }, lcd=lcd, idle_handler=backlight_idle, idle_time=5, input_handler=Text())
5) """ If you want menu items to appear in a defined order, you must add them one at a time using 'add_item'. This method accepts a plugin instance, plus the path where you want it to appear. 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. """ menu.add_item('Space Invader', my_invader) menu.add_item('Clock', Clock()) menu.add_item('Status/IP', IPAddress()) menu.add_item('Status/Test', '') menu.add_item('Status/CPU', GraphCPU()) menu.add_item('Status/Arrr', 'Blah blah') menu.add_item('Status/Temp', GraphTemp()) menu.add_item('Settings/Display/Contrast', Contrast(lcd)), menu.add_item('Settings/Display/Backlight', Backlight(backlight)) """ You can use anything to control dot3k.menu, but you'll probably want to use dot3k.joystick """ REPEAT_DELAY = 0.5 @joystick.on(joystick.UP)