


Restart Thonny to activate this behavior. # For demo purposes, we have an infinite loop here To do this, open up Thonny and head to Tools > Options > General and untick 'Allow only single Thonny instance'. Print("Welcome to Pico example 2, blinking an LED") Step 1-) Allow multiple Thonny Instances. By the end of this tutorial, you will be able to send messages between multiple Raspberry Pi Pico W’s to build a true IoT distributed system.
#Thonny pi pico how to#
The first thing we will do is create a new file, and we will paste this example code: import time Learn how to send information between Raspberry Pi Pico W’s anywhere using MQTT in MicroPython. Don’t worry, the process is as easy as saving… Pin(25, Pin.OUT).high() Program the microcontrollerĪbove you saw that simply by pressing the Execute button, the program was executed in the microcontroller without the need to program it, but what happens when we want the program to be permanent. For example, if we run these two lines on that console, we will turn on the led on the board: from machine import Pin This console allows us to execute the commands live.
#Thonny pi pico code#
The central part of the program is where we will program the code that we want to execute in the Microcontroller (or upload it), and finally we have the lower area, which is a direct console with the microcontroller. Obviously this execution is volatile and will not persist in the microcontroller after restarting it. Unlike Arduino, we can execute the code directly without uploading it to the microcontroller, so we can load a file with the second button, and then press the Execute button to launch it.
