Template: Pico Kit B Guides

From Waveshare Wiki
Jump to: navigation, search

Software Setup

Please follow the guides of Raspberry Pi to install and set up Pico for the Pico.

For easy use, we recommend you use the Thonny tool.

  • Thonny website
  • Please set the Thonny development environment to be RaspberryPi when setting
Pico-R3-Tonny1.png

Hardware Connection

Please take care of the direction when you connect Pico, an USB port is printed to indicate. You can also check the pin of Pico and the LCD board when connecting.
You can connect the display according to the table.

LCD Pico Description
VCC VSYS Power Input
GND GND GND
MPU.INT GP2 INT pin of MPU9250
LPS.INT GP3 INT pin of LPS22HB
SDA GP6 SDA pin of I2C
SCL GP7 SCL pin of I2C
FSYNC GP22 FSYNC pin of MPU9250

Connect the expansion board

Raspberry-Pi-Pico-Kit-B-2.jpg

Download the examples

Open a Raspberry Pi terminal and run the following commands:

sudo apt-get install p7zip-full
cd ~
sudo wget  https://www.waveshare.com/w/upload/c/c5/Pico-Kit-B-code.7z
7z x Pico-Kit-B-code.7z -o./Pico-Kit-B-code
cd ~/Pico-Kit-B-code
cd c/build/

How to use

C Example

Go to the directory of C example and build it

cd ~/Pico-Kit-B-code/c/

Create the build folder and enter it. add the SDK:

../../pico-sdk #should be the path of the SDK according to the actual situation.

We have created the build folder in the example, you can just enter it.

cd build
export PICO_SDK_PATH=../../pico-sdk
(Note: Please check if you set the correct path of SDK, it maybe different for different users)

Run cmake to generate the Makefile

cmake ..

Run make to build the example, it will takes minutes.

make -j9

uf2 is generated after building.
Press and hold the button of the Pico board, and then connect the Pico to your Raspberry Pi or PC by USB cable, then release the button. Then copy the main.uf2 file which is saved in the build folder to the Pico (It should be recognized as a portable drive, which is named RPI-RP2).

Python example

Work with windows PC

  • 1. Press and hold the BOOTSET button of Pico, and connect the Pico to your PC by USB cable. Release the button if the Pico is recognized as a portable drive.
  • 2.Copy the rp2-pico-20210205-unstable-v1.14-8-g1f800cac3.uf2 from the python directory to the Pico.
  • 3.Open Thonny IDE (Note: Please use the newest version).
  • 4.Click Tools->Options->Interpreter and choose the Port of Pico (you can check it in the Device Manager).

Raspberry-Pi-Pico-Basic-Kit-M-3.png

  • 5. Click File->Open..., choose Raspberry-Pi-Pico-Kit-B.py, and run it.

Pico-lcd-0.96-img-run.png

Working with Raspberry Pi

  • 1.The steps to download the firmware is the same as Windows PC. Copy the rp2-pico-20210205-unstable-v1.14-8-g1f800cac3.uf2 to Pico.
  • 2.Open the Thonny IDE in Raspberry Pi(Menu -> Programming -> Thonny Python IDE , you can check the version information in Help->About Thonny make sure that it is the version which support Pico.
  • 3.Click Tools -> Options... -> Interpreter to choose the MicroPython(Raspberry Pi Pico and the ttyACM0 port.

Pico-lcd-0.96-img-config2.png
Please update the Thonny IDE if the pre-installed one doesn't support Pico.

sudo apt upgrade thonny
  • 3.Click File->Open...->Pico-Kit-B-code/python/Raspberry-Pi-Pico-Kit-B.py and run the codes.

Expected result

  • 1. The LCD keeps blank if you didn't run the demo codes;
  • 2. After running the codes, the LCD turns on and displays the data which is collected by the Pico-10DOF-IMU.

Raspberry-Pi-Pico-Kit-B-details-3.gif