2024-03-05 16:10:20 +08:00
|
|
|
## i2c python3
|
|
|
|
|
|
|
|
|
|
1. 必须安装
|
|
|
|
|
```shell
|
|
|
|
|
apt install -y fonts-wqy-microhei fonts-wqy-zenhei
|
|
|
|
|
apt install -y i2c-tools libgpiod-dev
|
|
|
|
|
apt install -y python3-pip python3-pil python3-libgpiod
|
2025-08-29 22:15:59 +08:00
|
|
|
## 安装依赖
|
|
|
|
|
## 开发环境
|
|
|
|
|
cd i2c.py
|
|
|
|
|
python3 -m venv .venv
|
|
|
|
|
source .venv/bin/activate
|
|
|
|
|
pip3 install adafruit-circuitpython-ssd1306
|
|
|
|
|
## 系统依赖
|
|
|
|
|
pip3 install adafruit-circuitpython-ssd1306 --break-system-packages
|
2024-03-05 16:10:20 +08:00
|
|
|
```
|
|
|
|
|
2. 调试
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
python3 ./status.py
|
|
|
|
|
```
|
|
|
|
|
3. rc-local
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
vim /etc/rc.local
|
|
|
|
|
# 在 exit 0 之前添加
|
|
|
|
|
python3 /home/yong/i2c.py/status.py &
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|