void main()
{
Init_Timer1();
LCD_Init();
LCD_Clear();
LCD_Write_String(0,0," Capacitance ");
LCD_Write_String(0,1,“Cap: UF”);
while(1)
{
if(k10){TR0=1;TR1=1;}
if(k20){asd=0;}
if(asd>1000000)
{LCD_Write_Char(5,1,q1[asd/100000000]);
LCD_Write_Char(6,1,q1[asd%100000000/10000000]);
LCD_Write_Char(7,1,q1[asd%10000000/1000000]);
LCD_Write_Char(8,1,’.’);
LCD_Write_Char(9,1,q1[asd%1000000/100000]);
LCD_Write_Char(10,1,q1[asd%100000/10000]);
LCD_Write_Char(11,1,q1[asd%10000/1000]);
LCD_Write_Char(14,1,‘U’);
LCD_Write_Char(15,1,‘F’);}
else
{
LCD_Write_Char(5,1,q1[asd%1000000/100000]);
LCD_Write_Char(6,1,q1[asd%100000/10000]);
LCD_Write_Char(7,1,q1[asd%10000/1000]);
LCD_Write_Char(8,1,’.’);
LCD_Write_Char(9,1,q1[asd%1000/100]);
LCD_Write_Char(10,1,q1[asd%100/10]);
LCD_Write_Char(11,1,q1[asd%10]);
LCD_Write_Char(14,1,‘N’);
LCD_Write_Char(15,1,‘F’);
}
}
}
void t0() interrupt 1 using 1
{
TH0=(65536-50000)/256;//重新赋值 10ms
TL0=(65536-50000)%256; //1us
i++;
if(i==20)
{i=0;
num=num165535+TH1256+TL1;
asd=470000000/num;
TR0=0;TR1=0;
TH0=(65536-50000)/256;//重新赋值 10ms
TL0=(65536-50000)%256; //1us
num1=TH1=TL1=0;
}
}
void Timer1_isr(void) interrupt 3
{
TH1=0x00; //重新给定初值
TL1=0x00;
num1++;
}
转载自原文链接, 如需删除请联系管理员。
原文链接:这段LCD显示程序是什么意思,为什么出现这么多asd/100000000,转载请注明来源!