做一个测温的界面,界面如图所示,想让数字显示在叠加上面
使用 LCD_ShowxNum(30,60, temperature/10,2,24,0x81)函数,结果就出现了数字叠加,慢慢就变得比较模糊,求解决!!!
while(DS18B20_Init())
{
LCD_ShowxString(30,40,200,30,24,1,"DS18B20 ERROR!");
delay_ms(200);
}
LCD_ShowxString(30,40,200,30,24,1,"DS18B20 IS OK!");
LCD_ShowxString(30,60,200,30,24,1,"Temp: . C ");
while(1)
{
if(t%10==0)
{
temperature=DS18B20_Get_Temp();
if(temperature<0)
{
LCD_ShowChar(30+40,60,'-',24,1);
temperature=-temperature;
}
else
{
LCD_ShowChar(30+40,60,' ',24,1);
}
LCD_ShowxNum(30+50+25,60, temperature/10,2,24,0x81);
LCD_ShowxNum(30+50+55,60, temperature%10,1,24,0x81);
}
delay_ms(10);
t++;
if(t==20)
{
t=0;
led0=!led0;
}
}
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
54545454545
一周热门 更多>