def red(): print ('red') stop() async def temp(): pixels_fill(RED) pixels_show() make_task(temp)
def ablue(): "Menu function One way to call an async function" stop() async def temp(): pixels_fill(BLUE) pixels_show() make_task(temp)
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
def yellow(): stop() async def dummy(): pixels_fill(YELLOW) pixels_show() make_task(dummy)
def rainbow(): "call an async function defined elsewhere" print('start 333 rainbow') stop() make_task(rainbow_cycle)