Raspberry Pi Pico Projects

Getting Started With Raspberry Pi Pico With Thonny IDE

Raspberry Pi Pico With Thonny IDE

In this tutorial, we will show how to set up Raspberry Pi Pico With Thonny IDE I Raspberry Pi Pico is a low-cost, high-performance microcontroller board with a flexible digital interface. It is designed to be used with the MicroPython programming language, which is a very efficient implementation of the Python 3 programming language. Micropython is a version of python that has been designed to run on microcontrollers. This means that you can write python code that will run directly on your Raspberry pi pico board,

What is Raspberry Pi Pico?

Getting Started With Raspberry Pi Pico With Thonny IDE

Raspberry Pi Pico is an effective yet inexpensive microcontroller that was recently launched by the Raspberry Pi Foundation. This microcontroller is different from other microcontrollers available in the market because it is built on a brand new chip, the RP2040. The Pico also has a variety of peripherals that can be used with Micropython, including GPIO, I2C, SPI, and UART. I don’t want to lecture about the Raspberry pi Pico in the full detail here. you can check here  Getting Started Raspberry Pi Pico – Pinout, Specs – Beginner Guide

What is Micropython?

Python is a programming language with many features, but one of the best things about it is that it’s easy to learn That’s where micropython comes in. Micropython is a version of python that has been designed to run on microcontrollers. This means that you can write python code that will run directly on your microcontroller, without the need for an operating system. This makes micropython perfect for writing code that needs to run quickly and efficiently, without the overhead of an operating system.

Ad

Why Micropython?

There are a number of reasons why you might want to use Micropython on the Pico. One reason is that it is a great way to learn about programming and electronics. Micropython is a very simple and concise language that is easy to learn.

The Pico also has a number of tutorials and examples available that show you how to use Micropython to control various hardware peripherals. Another reason to use Micropython on the Pico is that it is an excellent way to develop prototypes.

What is Thonny IDE?

Ad

Thonny IDE is a Python development environment that is designed to be simple and easy to use for beginners. Thonny comes with Python 3.7 built-in, so just make sure to have that installed on your computer. Thonny’s user interface is very straightforward. You can write Python code in the code editor and execute it in the debug viewer. It has a very intuitive user interface and a wide range of features that make it a great tool for learning and developing Python applications.

Why use Thonny IDE?

Raspberry Pi Pico is a microcontroller based on the RP2040 microcontroller chip and can be programmed using the Thonny IDE. Raspberry Pi Pico is a great microcontroller board for beginners. It is easy to use and can be programmed using the Thonny IDE. Thonny IDE is a great development environment for beginners and it makes it easy to develop for the Raspberry Pi Pico.

Raspberry Pi Pico is a great choice for beginners who want to learn microcontroller programming. Thonny IDE makes it easy to get started with programming on Raspberry Pi Pico.

How to get started with Raspberry Pi Pico With Thonny IDE?

Raspberry Pi Pico is a microcontroller board based on the RP2040 chip. It was released in January 2021. Thonny IDE is a Python IDE for Raspberry Pi Pico. that comes bundled with the Raspberry Pi OS, so you don’t need to install anything. Just open the Thonny IDE and you’re ready to go. Raspberry Pi Pico is a great little board for starting development with Python. In this guide, we will show you how to get started with Raspberry Pi Pico and Thonny IDE.

Install Thonny IDE and Start MicroPython :

You can program your Raspberry Pi Pico using MicroPython by attaching it to a computer via USB and then dragging and dropping files to it.

  • Install MicroPython to Pico
  • Install Thonny IDE
  • Upload codes

Installing MicroPython & Thonny IDE

Installation of MicroPython on Raspberry Pi Pico needs a “UF2” file to stand copied onto it. A UF2 file is a “binary data file” which contains a program that can be communicated from a PC to a microcontroller, such as an ESP32 or Pico circuit board.

Raspberry Pi Pico uf2 File

The uf2 file below Download the MicroPython UF2 file from the below link;

To Install MicroPython on Pico board:

  1. Download the “MicroPython UF2 file” from here.
  2. Attach the cable to the  Raspberry Pi Pico & then push and hold the “BOOTSEL” button before plugging the USB cable into the computer.
  3. Release BOOTSEL once the drive RPI-RP2 seems on your computer.Raspberry Pi Pico uf2 file
  4. Drag the UF2 file onto the RPI-RP2.
  5. Your Pico will reboot. That’s it, you are nowrunning MicroPython on your Pico.
  6. Visit the Raspberry Pi Official Documentation page from here: Raspberry Pi Documentation.
Firmware & Releases

Raspberry Pi Pico With Thonny IDE Setup

  1. Download Thonny IDE from here and install it.
  2. Open Thonny
  3. Connect the Raspberry Pi Pico to your computer. ,

Raspberry Pi Pico With Thonny IDE

4. Go to “tools” –> “options” –> “interpreter” –> select “MicroPython (Raspberry Pi Pico)” as the interpreter and select the COM port being used.

5. The port dropdown menu can be left to “automatically detect the Pico”. Click “OK” to close.

(NOTE: There’ll be a prompt asking to install MicroPython, click yes (as shown in the figure), and then you can check in a shell that Pico is connected.) Thonny Setup tutorial From Adafruit 

Conclusion

Writing Blink Code for the onboard LED of pico board.

from machine import Pin
import utime
led = Pin(25, Pin.OUT)
led.low()
while True:
    led.toggle()
    print("Toggle")
    utime.sleep(1)

Click in the primary editor panel of Thonny and enter the following code to toggle the onboard LED.

Click the “Run” button to complete the code.

Save the program on the Raspberry Pi Pico and give the name blink.py make sure While saving the file it is a name main.py

When the code will run & you can see the LED toggling on the board

Related Posts:

 

Leave a Reply

Your email address will not be published.

Related Articles

Ad
Back to top button