Template: Pico UPS Guide
From Waveshare Wiki
Setup Environment
1. For the Raspberry Pi environment setting, please refer to link.
2. For the Windows environment setting, please refer to link.
Working with Raspberry Pi
1. Open a terminal of Raspberry Pi by SSH or press Ctrl+Alt+T at the same time while using the screen to open the terminal.
2. Download and unzip the demo codes to the directory Pico C/C++ SDK. Reference for users who have not yet installed the SDK.
wget -P ~/pico https://files.waveshare.com/upload/9/92/Pico-UPS-A.zip cd ~/pico unzip Pico-UPS-A.zip
C examples
- Press the BOOTSEL button of Pico and connect the Pico to your Raspberry Pi by USB cable and then release it.
- Build and run the C examples
cd ~/pico/Pico-UPS-A/c/build/ cmake .. make sudo mount /dev/sda1 /mnt && sudo cp Pico_UPS.uf2 /mnt && sudo sync && sudo umount /mnt && sleep 2 && sudo minicom -b 115200 -o -D /dev/ttyACM0
- The expected result should be as figure below:
Python examples
- Access Raspberry Pi and open the Thonny.
- Open the example by the IDE and save
- Click the Run button to run the codes
Windows
- Download and unzip Demo to the Windows desktop, refer to Windows software environment settings.
- Press and hold the BOOTSEL button of Pico, connect Pico's USB to the PC with a MicroUSB cable, and import a c or python program into Pico to make it run.
- Use the serial port to view the virtual serial port of Pico's USB enumeration to view the printing information, pay attention to turning on DTR, the baud rate is 115200, as shown in the figure.