Skip to content
Discussion options

You must be logged in to vote

The correct way to create a task is asyncio.create_task(go_to_sleep() ), with ()

However, it's not a good idea to launch a task from a ISR (interrupt service routine) . Please see this excellent tutorial https://github.com/peterhinch/micropython-async/blob/master/v3/docs/INTERRUPTS.md

One good way to do this is to leave an asyncio task running always awaiting a ThreadSafeFlag that is set by the ISR.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ThinkTransit
Comment options

Answer selected by ThinkTransit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
ESP32
Labels
None yet
2 participants