You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you Sir, for your help in getting some asyncio code working, is there such a thing as :(sw.toggle_func)?
async def my_app():
pin = Pin(16, Pin.IN, Pin.PULL_UP) # Hardware: switch to gnd
red = led
sw = Switch(pin)
sw.close_func(pulse, (red, 1000)) # Note how coro and args are passed
sw.open_func(pulse, (red, 1000))
await asyncio.sleep(60) # Dummy application code
This was cut and pasted from your tutorial, I don't like callbacks, and wish to build
mqtt switches without loops that hide away in dark places.
Thanks
Brian
The text was updated successfully, but these errors were encountered:
Thank you Sir, for your help in getting some asyncio code working, is there such a thing as :(sw.toggle_func)?
async def my_app():
pin = Pin(16, Pin.IN, Pin.PULL_UP) # Hardware: switch to gnd
red = led
sw = Switch(pin)
sw.close_func(pulse, (red, 1000)) # Note how coro and args are passed
sw.open_func(pulse, (red, 1000))
await asyncio.sleep(60) # Dummy application code
This was cut and pasted from your tutorial, I don't like callbacks, and wish to build
mqtt switches without loops that hide away in dark places.
Thanks
Brian
The text was updated successfully, but these errors were encountered: