4. Python

4.1 Data download

Python information contains library files、project code and firmware,please click to download for follow-up study.

Data download: Python

4.2 Download Thonny

For Windows——Operating System: Windows 10

Enter Thonny IDE official to download the Thonny for Windows version.

image1

image2

For MAC

Please refer to Windows.

image3

image4

4.3 Install Thonny

Thonny supports two installation methods:

  • Thonny+Python package

    Python IDE and Thonny are packaged together and can be directly installed and used. It is fast and easy so is recommended for beginners. There are also two ways to install this package:

    • Installer

    image5

    • Portable variant

    image6

  • Thonny only

    Thonny is actually a package of python. When the user already has a python environment, click pip install thonny to install Thonny only, which is more suitable for developers.

image7

Please download the corresponding version according to your requirements.

4.3.1 Installer

Download the app according to your operation system. Here we demonstrate under 64bit Windows 10 to download Installer with 64-bit Python 3.10.

  1. Clickimage8and you will see “Select Setup Install Mode”. Choose Install for me only.

image9

  1. Next.

image10

  1. Tick I accept the agreement and Click Next.

image11

  1. The default installation path is in Disk C. You may click Browse… to choose another disk. And then click Next.

image12

  1. By default, a shortcut to the program is created in the Start menu folder. Click Browse… to set another path for the shortcut and Next.

image13

  1. Tick Create desktop icon and Next.

image14

  1. Install.

image15

  1. Finish”!

image16

  1. Back to the desktop and start Thonny to choose a language.

image17

  1. Done.

image18

4.3.2 Portable Variant

Download the app according to your operation system. Here we demonstrate under 64bit Windows 10 to download Installer with 64-bit Python 3.10.

  1. Clickimage19to start Thonny and choose a language.

image20

  1. Done.

image21

4.4 Burn Firmware (Important)

To run MicroPython code on Pico, it is necessary to burn MicroPython firmware to Pico.

image22

  1. Connect the board to your computer via Micro USB.

B. Press and hold the white button (BOOTSEL) on “Raspberry Pi Pico”. Then, connect the Raspberry Pi Pico to the computer via a microUSB cable.

image23

C. Release the button. After connection, open [Device Manager] and your computer will automatically recognize the removable disk (RPI-RP2) as follows:

image24

D. Copy the RPI_PICO-20250809-v1.26.0.uf2 file from the “Firmware” folder to the removable disk (RPI-RP2), just like copying a file to a USB flash drive, and then wait for it to complete.

image25

E. After burning the firmware, Raspberry Pi Pico will restart. After that, you can run Micropython.

4.5 Homepage

Click View and tick Files to open the file manager.

image26

image27

4.6 Toolbar

image28

Icon

Function

image29

New

image30

Open…

image31

Save

image32

Run current script

image33

Debug current script

image34

Step over

image35

Step into

image36

Step out

image37

Resume

image38

Stop/Restart backend

4.7 Connect Pico to Thonny

Connect the Pico development board to the computer, then set the development board to Pico and select the port.

Click Tools–>Options...

image39

Select Interpreter , then set the development board to MicroPython(Raspberry Pi Pico), and choose the ports automatically recognized, and click OK.

image40

After connection, “Raspberry Pi Pico” will appear on the left side of Thonny and there will also be a prompt in the lower right corner.

image41

4.8 Load Code from Computer

Note: You need to download the required data files from 1.Download code and library files and extract them to your desktop.

Click Files –> This computer, open the file Resources.

image42

Enter codes and you can see the codes. Click it to open the file in Thonny.

image43

4.9 Upload Library to Pico

Errors may be reported during running code without saving the library to Pico.

image44

Add library:

In Files, open Resources –> lib to check library:

image45

Choose mecanumCar_v2.py to “Upload to/”.

After that, mecanumCar_v2.py is displayed in “Raspberry Pi Pico”.

4.10 Project