Timer and Threads on Raspberry Pi Pico with BIPES

Some days ago, Rudolf Schenke sent a message suggesting a block for threads on Raspberry Pi Pico. This site has a good explanation about threads on RPI Pico + MicroPython:
https://www.electrosoftcloud.com/en/multithreaded-script-on-raspberry-pi-pico-and-micropython/

We implemented 2 simple blocks: one for timer and one for threads.

They can be used together, so we can get 3 tasks at once! Take a look at these 2 examples:

Example 1
Timer blinks LED with 222 milliseconds interval while main prints messages to serial console at each 1 second.

pico timer

pico timer

Example 2
Timer prints “Pico Timer” to serial console at each 500 milliseconds. Thread 1 prints “Thread 1” to console at each 222 milliseconds and finally, main prints “Main: xxx” each 2 seconds, where xxx is the number of milliseconds since the Pi Pico booted.

pico timer thread

pico timer thread

Example 2 Result

pico timer thread result

pico timer thread result

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s