新增数据处理脚本,可以画折线图

This commit is contained in:
2024-01-15 00:45:08 +08:00
parent b74569668e
commit bd8d7778b0
4 changed files with 69 additions and 2 deletions

View File

@@ -28,6 +28,7 @@ void main(void)
int pre_temp_value=0;
int temp_value=0;
u8 temp_buf[5];
int HH=0, MM=0, SS=0;
uart_init(0XFA);//波特率为9600
ds18b20_init();//初始化DS18B20
@@ -59,8 +60,20 @@ void main(void)
// }
// delay
delay_ms(1000);
printf("temp = %.1f\r\n", temp_value/10.0);
if(temp_value != 0) {
SS ++;
if (SS == 60){
SS = 0;
MM ++;
}
if(MM == 60){
MM = 0;
HH ++;
}
delay_ms(1000);
printf("%02d:%02d:%02d temp = %.1f\r\n", HH, MM, SS, temp_value/10.0);
}
}
}