Esempio n. 1
0
clock = Clock(backlight)
"""
Using a set of nested dictionaries you can describe
the menu you want to display on dot3k.

A nested dictionary describes a submenu.
An instance of a plugin class ( derived from MenuOption ) can be used for things like settings, radio, etc
A function name will call that function.
"""
menu = Menu(
    {
        'Clock': clock,
        'Radio Stream': Radio(),
        'Volume': Volume(backlight),
        'Status': {
            'CPU': GraphCPU(),
            'Temp': GraphTemp()
        },
        'Settings': {
            'Contrast': Contrast(lcd),
            'Backlight': Backlight(backlight)
        }
    },
    lcd,  # Draw to dot3k.lcd
    clock,  # Idle with the clock plugin,
    10  # Idle after 10 seconds
)
"""
You can use anything to control dot3k.menu,
but you'll probably want to use dot3k.touch
"""
Esempio n. 2
0
"""
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)
def handle_up(pin):
    menu.up()
Esempio n. 3
0
clock = Clock(backlight)
"""
Using a set of nested dictionaries you can describe
the menu you want to display on dot3k.

A nested dictionary describes a submenu.
An instance of a plugin class ( derived from MenuOption ) can be used for things like settings, radio, etc
A function name will call that function.
"""
menu = Menu(
    {
        'Clock': clock,
        'Radio Stream': Radio(),
        'Volume': Volume(backlight),
        'Status': {
            'CPU': GraphCPU(backlight),
            'Temp': GraphTemp()
        },
        'Settings': {
            'Contrast': Contrast(lcd),
            'Backlight': Backlight(backlight)
        }
    },
    lcd,  # Draw to dot3k.lcd
    clock,  # Idle with the clock plugin,
    10  # Idle after 10 seconds
)
"""
You can use anything to control dot3k.menu,
but you'll probably want to use dot3k.joystick
Esempio n. 4
0
menu = Menu(
    structure={
        'System': {
            'Boot Options': {
                'Shutdown': GraphSysShutdown(),
                'Reboot': GraphSysReboot()
            },
            'Settings': {
                'Display': {
                    'Contrast': Contrast(picecold.lcd),
                    'Backlight': Backlight(picecold.backlight)
                }
            }
        },
        'Status': {
            'IP': IPAddress(),
            'CPU': GraphCPU(picecold.backlight),
            'Temp': GraphTemp()
        }
    },
    lcd=picecold.lcd,
    input_handler=Text())

picecold.add_to_menu(menu)

# nav.enable_repeat(True)

while True:
    menu.redraw()
    time.sleep(0.025)