
DS18B20温度传感器: DS18B20
5星
- 浏览量: 0
- 大小:None
- 文件类型:ZIP
简介:
DS18B20是一款数字温度传感器,具有独特的单总线通信接口。它能够测量范围从-55°C到+125°C的温度,并提供9至12位分辨率可选。这款传感器广泛应用于各种需要精确测温的场合。
# DS18B20 温度传感器与Python
## 在 Raspberry Pi 上运行(我实际上使用 Archlinux 运行)
### 使用 Systemd 定时器
ds18b20.timer 文件内容如下:
```
[Unit]
Description=Run ds18b20 for temperature
[Timer]
OnBootSec=1min
OnUnitActiveSec=1min
[Install]
WantedBy=timers.target
```
#### ds18b20.service 文件内容如下:
```
[Unit]
Description=Run ds18b20 sensor
[Service]
User=your-username
ExecStart=/usr/bin/env python /path/to/temperature.py
```
全部评论 (0)
还没有任何评论哟~


