一个1602显示温度子程序,看不懂,求注释~
void disp_temp(){
uchar tempinth,tempintl,tempinbai,shifen,baifen,gefen,mi;
tempinbai=tempint/100;
tempinth=tempint%100/10; //整数取模
tempintl=tempint%10; //整数取模
baifen =tempdf%10000/1000;
shifen=tempdf%1000/100;
gefen=tempdf%100/10; //小数取模
mi=tempdf%10;
write_com(0x80+0x46);
if(f==0)
{
write_date(0x30+tempinbai);
}
else
write_date('-');
write_date(0x30+tempinth);
write_date(0x30+tempintl);
write_date('.');
write_date(0x30+ baifen);
write_date(0x30+shifen);
write_date(0x30+gefen);
write_date(0x30+mi);
write_date('C');
write_com(0x80+0x44);
delay(10);
}
谢谢各位啦!~