示例#1
0
def red():
    print ('red')
    stop()   
    async def temp():
        pixels_fill(RED)
        pixels_show()
    make_task(temp)
示例#2
0
def ablue():
    "Menu function One way to call an async function"
    stop()
    async def temp():
        pixels_fill(BLUE)
        pixels_show()
    make_task(temp)
示例#3
0
def showcolour():
    global menu_data
    "Menu function.  Ignores self and makes neopixels blue"
    print('menu_data',menu_data.get('colour1','RED'))
    stop()
    try:
        async def dummy():
            print('dummy menu_data',menu_data)
            s =  menu_data.get('colour1','GREEN')
            print('to be eval',s)
            coltup = eval(s)
            print('coltup',coltup)
            pixels_fill(coltup)
            pixels_show()
        make_task(dummy)
    except:
        pass
示例#4
0
def yellow():
    stop()
    async def dummy():
        pixels_fill(YELLOW)
        pixels_show()
    make_task(dummy)
示例#5
0
def rainbow():
    "call an async function defined elsewhere"
    print('start 333 rainbow')
    stop()
    make_task(rainbow_cycle)