Skip to content

Commit 5ee5e9b

Browse files
committed
update readme
Signed-off-by: Wooden Chair <hua.zheng@embeddedboys.com>
1 parent d852523 commit 5ee5e9b

1 file changed

Lines changed: 80 additions & 8 deletions

File tree

README.md

Lines changed: 80 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,31 @@ Go to the Github Release page and download the prebuilt firmware uf2 file.
2626

2727
Also, If you want to compile the firmware yourself (Assuming you are using a Ubuntu machine)
2828

29-
1. Install the [Pico SDK](https://github.com/raspberrypi/pico-sdk)
29+
#### 1. Install the [Pico SDK](https://github.com/raspberrypi/pico-sdk)
3030

3131
```bash
3232
git clone https://github.com/raspberrypi/pico-sdk.git ~/pico-sdk
3333
cd ~/pico-sdk
3434
git submodule update --init
3535
```
3636

37-
2. Install CMake (at least version 3.13), python 3, a native compiler, and a GCC cross compiler
37+
#### 2. Install CMake (at least version 3.13), python 3, a native compiler, and a GCC cross compiler
3838

3939
```bash
4040
sudo apt install cmake python3 build-essential gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib ninja-build
4141
```
4242

43-
3. Select the config you need, open `CMakeLists.txt` and :
43+
#### 3. Clone this repo
44+
45+
```bash
46+
git clone https://github.com/embeddedboys/Pico-USB-Display.git
47+
cd Pico-USB-Display
48+
```
49+
50+
#### 3. Select the config you need, open `CMakeLists.txt` and :
51+
52+
==You can find the pin definitions in the configuration file.==
53+
4454
```cmake
4555
# ********** select the suitable config file **********
4656
include(${PICO_DISPLAY_LIB_CONFIG_PATH}/pico_dm_qd3503728.cmake)
@@ -50,9 +60,7 @@ include(${PICO_DISPLAY_LIB_CONFIG_PATH}/pico_dm_qd3503728.cmake)
5060
# include(${PICO_DISPLAY_LIB_CONFIG_PATH}/generic-st7789v.cmake)
5161
```
5262

53-
**You can find the pin definitions in the configuration file.**
54-
55-
4. Then build the firmware
63+
#### 4. Then build the firmware
5664
```bash
5765
mkdir -p build && cd build
5866
cmake .. -G Ninja
@@ -72,10 +80,74 @@ Memory region Used Size Region Size %age Used
7280

7381
You can find the firmware in the `build` directory.
7482

75-
#### Flash the firmware to your Pico board
83+
#### 5. Copy the udev rules to `/etc/udev/rules.d/`
84+
85+
If you don't want to access USB devices with root privileges, then you need to configure udev rules correctly.
86+
```bash
87+
sudo cp 50-pico-usb-display.rules /etc/udev/rules.d/
88+
89+
# Then reload the udev rules
90+
sudo udevadm control --reload-rules && sudo udevadm trigger
91+
```
92+
93+
#### 6. Flash the firmware to your Pico board
7694

7795
Pico has provided a bootloader that can easily flash the firmware to the Pico board. Hold the `BOOTSEL` button while plugging in the Pico board, and a drive named `RPI-RP2` or `RP2350` will be mounted. Then you can copy the `pico-usb-display.uf2` file to the drive and the firmware will be flashed to the Pico board.
7896

7997
Once the firmware flashing is complete, you will see some content displayed on the screen. Here is an example:
8098

81-
![boot](./assets/bootlogo.jpg)
99+
![boot](./assets/bootlogo.jpg)
100+
101+
### Display Pictures and videos
102+
103+
If you don't want to hack, then a Python script is the simplest way to use it, but DRM driver or other methods (in the future) are more effcient.
104+
105+
#### Python script
106+
107+
create a python3 venv and install requierments
108+
109+
```bash
110+
python3 -m venv .venv
111+
source .venv/bin/activate
112+
113+
pip install pyusb opencv-python numpy
114+
```
115+
116+
If you want to show a picture on pico display:
117+
```bash
118+
# Usage: ./scripts/img_viewer.py [xres] [yres] <file.jpg>
119+
120+
./scripts/img_viewer.py 480 320 ~/Pictures/artplayer_19_21.png
121+
```
122+
123+
Or you want to play a video on the pico display:
124+
```bash
125+
# Usage: ./scripts/video_player.py [xres] [yres] [quality|1-100] <video.mp4>
126+
127+
./scripts/video_player.py 480 320 50 ~/Videos/jazz_15fps.mp4
128+
```
129+
130+
You probably also want to know how to set the video to 15fps:
131+
```bash
132+
ffmpeg -i ./jazz.mp4 -vf "fps=15" -c:v libx264 -preset fast -crf 23 -c:a copy ./jazz_15fps.mp4
133+
```
134+
135+
#### Kernel driver
136+
137+
```bash
138+
git clone https://github.com/embeddedboys/PUD-kernel-drivers
139+
cd PUD-kernel-drivers
140+
141+
make
142+
sudo insmod pud.ko
143+
```
144+
145+
Then you can easily play the video using the following command:
146+
147+
```bash
148+
ffplay ./jazz.mp4
149+
```
150+
151+
## Links
152+
153+
- [PUD-kernel-drivers - A drm driver for Pico USB Display](https://github.com/embeddedboys/PUD-kernel-drivers)

0 commit comments

Comments
 (0)