5.3. Using the Thonny editor

Thonny is a Python editor for beginners that also includes advanced IDE features for editing and debugging code. After you download Thonny and install our plugin as described below, Thonny will recognize the Zumo and help you interact with the MicroPython interpreter running on its control board.

Installing Thonny and connecting to the Zumo

Install the latest version from the Thonny website. Start the program, open the Tools menu, and click “Manage plug-ins…”:

Search for “thonny-pololu”, select the corresponding plugin from PyPi, and click “Install”:

Important: Restart Thonny after installing the plugin. Next, connect your robot to your computer with a USB cable. You should be able to select an option for the Zumo from the interpreter menu in the lower-right corner of Thonny:

Note: If Thonny does not show the “Pololu Zumo 2040 Robot” option here, something is wrong with the plugin install. You can program the board as a Pico or generic RP2040 board, but there will be more confusing options for file loading and saving.

Your currently-running program on the Zumo will stop, and the “Shell” window will show a MicroPython prompt (“REPL”). (If it doesn’t connect or isn’t showing any output, try clicking “Stop” to get connected.)

Using Thonny to interact with the MicroPython interpreter

Next, you can try typing some commands in the Shell window:

If basic commands work, you can try using the hardware on the Zumo:

Next, open the file blink.py from the robot’s drive in the Thonny editor. Assuming you are still connected and see the MicroPython prompt, you can click the green Run button at the top or press F5 to run it immediately. The LED should begin blinking. To stop the program you can press Ctrl+C. Try that now and run the code again with the Run button or F5. Make some modifications and see that the blink pattern changes.

If you save your changes, you will be able to access them from the demo menu system later. To start the demo program, press Ctrl+C (to stop the running program) then Ctrl+D (“soft” reboot).

Upgrading firmware with Thonny

Note: Loading a firmware file will delete all programs and data stored on your robot. Make sure you have anything you are working on backed up before you proceed.

You can also upgrade the MicroPython firmware with Thonny. Get the robot into bootloader mode as described in Section 5.1, and you will see an “Install MicroPython” option in the Thonny’s interpreter menu:

Select this option and then find the appropriate device in the list of variants:

Thonny will automatically download and install our latest firmware version from the Internet.

Related Products

Zumo 2040 Robot Kit (No Motors)
Zumo 2040 Robot (Assembled with 50:1 HP Motors)
Zumo 2040 Robot (Assembled with 75:1 HP Motors)
Zumo 2040 Robot (Assembled with 100:1 HP Motors)
Zumo 2040 Main Board
Zumo 2040 Front Sensor Array
Log In
Pololu Robotics & Electronics
Shopping cart
(702) 262-6648
Same-day shipping, worldwide
Shop Blog Forum Support
My account Comments or questions? About Pololu Contact Ordering information Distributors