2. Install MicroPython on Your PicoΒΆ

MicroPython is a software implementation of a programming language largely compatible with Python 3, written in C, that is optimized to run on a microcontroller.

MicroPython consists of a Python compiler to bytecode and a runtime interpreter of that bytecode. The user is presented with an interactive prompt (the REPL) to execute supported commands immediately. Included are a selection of core Python libraries; MicroPython includes modules which give the programmer access to low-level hardware.

Now come to install MicroPython into Raspberry Pi Pico, Thonny IDE provides a very convenient way for you to install it with one click.

Note

If you do not wish to upgrade Thonny, you can use the Raspberry Pi official method by dragging and dropping an rp2_pico_xxxx.uf2 file into Raspberry Pi Pico.

  1. Open Thonny IDE.

    ../_images/set_pico1.png
  2. Press and hold the BOOTSEL button and then connect the Pico to computer via a Micro USB cable. Release the BOOTSEL button after your Pico is mount as a Mass Storage Device called RPI-RP2.

    ../_images/bootsel_onboard.png
  3. In the bottom right corner, click the interpreter selection button and select Install Micropython.

    Note

    If your Thonny does not have this option, please update to the latest version.

    ../_images/set_pico2.png
  4. In the Target volume, the volume of the Pico you just plugged in will automatically appear, and in the Micropython variant, select Raspberry Pi.Pico/Pico H.

    ../_images/set_pico3.png
  5. Click the Install button, wait for the installation to complete and then close this page.

    ../_images/set_pico4.png

Congratulations, now your Raspberry Pi Pico is ready to go.