Skip to content
Discussion options

You must be logged in to vote

And for asyncio, see https://github.com/peterhinch/micropython-async

Interrupts can be tricky. To check a sensor it's normally easier to start a second asyncio task with asyncio.create_task, with a loop to poll the sensor and asyncio.sleep_ms between 10 ms to 1 sec or more depending on what you want to achieve. This task will then run in parallel to the microdot server

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@raspberrypieman
Comment options

@sophiedegran
Comment options

@bixb922
Comment options

Answer selected by raspberrypieman
@raspberrypieman
Comment options

@raspberrypieman
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants