这是我程序的一部分,其他部分都正常,没有贴。然后问题是无论温度多少,在显示屏上显示的时候都显示 fast ,也就是永远判断温度在32度以上,而实际温度显示没有。
while(1)
{
if(t%10==0)
{
temperature=DS18B20_Get_Temp();
if(temperature<25){
LCD_ShowString(30,180,200,16,16,"close");
LCD_ShowNum(30+40+8,150,temperature/10,2,16);
LCD_ShowNum(30+40+32,150,temperature%10,1,16);
}
if(temperature<28&&temperature>25){
LCD_ShowString(30,180,200,16,16,"low");
LCD_ShowNum(30+40+8,150,temperature/10,2,16);
LCD_ShowNum(30+40+32,150,temperature%10,1,16);
}
if(temperature>32) {
LCD_ShowString(30,180,200,16,16,"fast");
LCD_ShowNum(30+40+8,150,temperature/10,2,16);
LCD_ShowNum(30+40+32,150,temperature%10,1,16);
}
if(temperature<32&&temperature>28){
LCD_ShowString(30,180,200,16,16,"medium");
LCD_ShowNum(30+40+8,150,temperature/10,2,16);
LCD_ShowNum(30+40+32,150,temperature%10,1,16);
}
|