Myvideo

Guest

Login

How to Use Asyncio in MicroPython (Raspberry Pi Pico) | Digi-Key Electronics

Uploaded By: Myvideo
11 views
0
0 votes
0

At this time, MicroPython does not support full multithreading (with the threading library). However, we can use uasyncio (the MicroPython version of the larger Python asyncio library) to create a cooperative multitasking program. Uasyncio contains a subset of functions found in the asyncio library. Some parts (like queues) are left out (at the time this video was released). In the video, we go over how cooperative multitasking compares to preemptive multitasking and how you can use uasyncio to create several tasks in a single program. Specifically, we will use the Raspberry Pi Pico to demonstrate how to read button presses in one loop and blink an LED in another loop. We will also show how to use a queue to pass messages between the tasks. The full code for this tutorial can be found here: Asyncio is based around the idea of “coroutines,” which behave like normal funct

Share with your friends

Link:

Embed:

Video Size:

Custom size:

x

Add to Playlist:

Favorites
My Playlist
Watch Later