Comments on: Raspberry Pi Pico Asynchronous Programming – Run Multiple Tasks (MicroPython) https://randomnerdtutorials.com/micropython-raspberry-pi-pico-asynchronous-programming/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Mon, 10 Mar 2025 10:58:55 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Angelo https://randomnerdtutorials.com/micropython-raspberry-pi-pico-asynchronous-programming/#comment-1015271 Mon, 10 Mar 2025 10:58:55 +0000 https://randomnerdtutorials.com/?p=163417#comment-1015271 Hi Sara,
I have successfully applied asynchronous programming in an application much more complex than the flashing of two LEDs used for the explanation and everything works perfectly. Thanks for the Tutorial!
Now I have to add the reading on I2C of an AD/C (ADS1115); the AD/C reading sw works if executed individually but not if inserted as a coroutine inside the asynchronous program. I imagine that this depends on the fact that the reading of the AD/C is interrupted by the asynchronous coroutines, which do their job.
If so, I ask you:
is it possible to temporarily interrupt the asynchronous execution of the coroutines, perform the A/D conversion without interruptions and then resume normal scheduling?
I specify that the AD/C routine could also be executed only every second or more, so as not to disturb the asynchronous activities too much.
In short, how can I make asynchronous and synchronous activities coexist?
Thank you.

]]>
By: Sara Santos https://randomnerdtutorials.com/micropython-raspberry-pi-pico-asynchronous-programming/#comment-986508 Mon, 25 Nov 2024 23:01:14 +0000 https://randomnerdtutorials.com/?p=163417#comment-986508 In reply to Stephen Brocket.

Great.
I’m glad the issue is solved.
Regards,
Sara

]]>
By: Stephen Brocket https://randomnerdtutorials.com/micropython-raspberry-pi-pico-asynchronous-programming/#comment-986413 Mon, 25 Nov 2024 15:02:41 +0000 https://randomnerdtutorials.com/?p=163417#comment-986413 In reply to Sara Santos.

Hi Sara – thanks for the advice! I updated the firmware as you suggested (following one of your other articles) and now asincio works fine.

Best regards,
Steve

]]>
By: Sara Santos https://randomnerdtutorials.com/micropython-raspberry-pi-pico-asynchronous-programming/#comment-985964 Sun, 24 Nov 2024 10:38:21 +0000 https://randomnerdtutorials.com/?p=163417#comment-985964 In reply to Stephen Brocket.

Hi.
Are you using a Raspberry Pi Pico?
Take a look at the firmware you’re loading.
Make sure you’re uploading a recent firmware version.
In recent versions the uasincio was replaced with asincio.
Probably you just need to upload the firmware with the most recent version.
Regards,
Sara

]]>
By: Stephen Brocket https://randomnerdtutorials.com/micropython-raspberry-pi-pico-asynchronous-programming/#comment-985939 Sun, 24 Nov 2024 09:19:29 +0000 https://randomnerdtutorials.com/?p=163417#comment-985939 Hi Rui and Sarah – this is a bit basic but I’m using Thonny and all I get is the ‘module not found’ error for asyncio. However if I use the line ‘import uasyncio as asyncio’ there appear to be no issues and the code works. I don’t know where to find the libraries or if I need to update something. can you help? (Apologies if this is covered elsewhere!)
Thanks for the great articles!

]]>
By: Sara Santos https://randomnerdtutorials.com/micropython-raspberry-pi-pico-asynchronous-programming/#comment-985677 Sat, 23 Nov 2024 17:29:30 +0000 https://randomnerdtutorials.com/?p=163417#comment-985677 In reply to Joe Margevicius.

I answered your question in the forum: https://rntlab.com/question/raspberry-pi-pico-versus-raspberry-pi-zero-w/

]]>
By: Joe Margevicius https://randomnerdtutorials.com/micropython-raspberry-pi-pico-asynchronous-programming/#comment-985659 Sat, 23 Nov 2024 15:18:46 +0000 https://randomnerdtutorials.com/?p=163417#comment-985659 … got it. Thanks. … I don’t know where to ask this question, but I’ll try here: What is the advantage of a Pi Pico versus a Pi Zero-W ? … both have small form factor. Both are low cost, but the Zero has so much more it can do with an operating system and a full python suite (again, I don’t know where to otherwise ask this … sorry).

]]>
By: Sara Santos https://randomnerdtutorials.com/micropython-raspberry-pi-pico-asynchronous-programming/#comment-985624 Sat, 23 Nov 2024 12:08:03 +0000 https://randomnerdtutorials.com/?p=163417#comment-985624 In reply to Joe Margevicius.

Hi.
This article is about the Raspberry Pi Pico, and not the “regular” Raspberry Pi.
Regards,
Sara

]]>
By: ChuckS https://randomnerdtutorials.com/micropython-raspberry-pi-pico-asynchronous-programming/#comment-985522 Sat, 23 Nov 2024 05:32:21 +0000 https://randomnerdtutorials.com/?p=163417#comment-985522 In reply to Sara Santos.

Ok, I reviewed the code (2 places) and the explanation section and they all agree.
Thanks for corrections.

]]>
By: ChuckS https://randomnerdtutorials.com/micropython-raspberry-pi-pico-asynchronous-programming/#comment-985520 Sat, 23 Nov 2024 05:27:47 +0000 https://randomnerdtutorials.com/?p=163417#comment-985520 In reply to Joe Margevicius.

You are correct that the Raspberry Pi runs Linux. And Python (CPython) allows multi-threading applications to be written.
However this article is about MicroPython running on a uController, specifically the Raspberry Pi Pico (although there is an article for the ESP32 (and its little sibling)). These uControllers do not run Linux, and may even run without any RTOS.

]]>