Skip to main content

Working with Raspberry Pi Pico

This chapter includes the following sections. Please read as needed:

Hardware Connection​

Connect the LCD module to the Raspberry Pi Pico using an 11PIN ribbon cable. The pin correspondence is as follows:

LCDRaspberry Pi Pico
VCC3.3 V
GNDGND
DINGPIO11
CLKGPIO10
CS1GPIO9
CS2GPIO13
DCGPIO8
RST1GPIO12
RST2GPIO15
BL1GPIO20
BL2GPIO21

MicroPython Environment Setup​

  1. Download and install the Thonny 3.3.3 installer.
  2. Press and hold the BOOTSEL button on the Raspberry Pi Pico, connect it to the computer via USB, and release the button after power-up.
  3. The computer will recognize a new disk. Download and extract the Raspberry Pi Pico MicroPython firmware, and copy the file with the .uf2 extension to that disk. After copying is complete, the Pico will automatically restart, and the disk will disappear.
  4. Open Thonny and click Python x.x.x in the lower-right corner, then select Configure interpreter.
  5. In the pop-up window, select Interpreter, set the interpreter to MicroPython (Raspberry Pi Pico), and select Auto-detect port for the port.
  6. Click the Stop button. When the MicroPython version information and the >>> prompt appear in the Shell window, the connection is successful. When using the firmware above, the version information is MicroPython v1.20.0-50-g786013d46 on 2023-05-04.

The interpreter configuration is as follows:

Thonny Raspberry Pi Pico Interpreter Configuration

The Shell window after a successful connection is as follows:

Thonny Shell Window Connected to Raspberry Pi Pico

Downloading Example Programs​

Download and extract the package from the 0.71inch DualEye LCD Module Example.

Open the extracted 0.71inch-DualEye-LCD-Module-Demo folder, find the Raspberry Pi Pico folder, and the Eye.py inside it is the example program used in this section.

Running the Example​

Before running, complete the Hardware Connection and MicroPython Environment Setup, and confirm that Thonny is connected to the Pico and the Shell window shows the >>> prompt.

  1. In Thonny, click File > Open..., or press Ctrl+O, and open the Raspberry Pi Pico/Eye.py extracted on the computer. If a file location selection window appears, select the file on the computer.

    Opening the Eye.py Example via the File Menu in Thonny

  2. Confirm that the editor has opened Eye.py, and click the green run button in the toolbar or press F5 to run the current script.

    Clicking the Green Run Button in the Thonny Toolbar

  3. Observe the LCD module. After the program runs normally, the two screens display eye animations with a blinking effect, as shown below. To stop the program, click the stop button in the Thonny toolbar.

    Raspberry Pi Pico Driving Two LCDs to Display Eye Animations