update
This commit is contained in:
parent
8ea43ebed0
commit
b11383c5bb
@ -38,8 +38,14 @@ uart_temp是用于8051单片机上的一个项目,用于获取温度,并使
|
||||
|
||||
4. 打开串口软件,接收来自单片机的数据
|
||||
|
||||
串口波特率:9600
|
||||
|
||||
```bash
|
||||
minicom -D /dev/ttyUSB0 -b 9600
|
||||
```
|
||||
|
||||
5. 运行`process.py`解析数据生成图片
|
||||
|
||||
|
||||
```bash
|
||||
# 新建虚拟环境
|
||||
virtualenv env
|
||||
|
BIN
SimHei.ttf
Normal file
BIN
SimHei.ttf
Normal file
Binary file not shown.
@ -21,7 +21,11 @@ for line in lines:
|
||||
timedelta(minutes=int(time_str.split(':')[1])) + \
|
||||
timedelta(hours=int(time_str.split(':')[0]))
|
||||
temperature = float(temp_str)
|
||||
if temperature >= 10 and temperature <= 40:
|
||||
if len(temperatures) > 0:
|
||||
pre_temp = temperatures[-1]
|
||||
else:
|
||||
pre_temp = temperature
|
||||
if pre_temp-0.5 < temperature < pre_temp+0.5:
|
||||
times.append(time)
|
||||
temperatures.append(temperature)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user