單片機(jī)數(shù)字電壓表
{
dispbuf[i]=temp%10;
temp=temp/10;
i++;
}
dispbuf[i]=temp;
ST=1;
ST=0;
}
}
}
void t0(void) interrupt 1 using 0
{
CLK=~CLK;
}
void t1(void) interrupt 3 using 0
{
TH1=(65536-4000)/256;
TL1=(65536-4000)%256;
P1=dispcode[dispbuf[dispcount]];
P2=dispbitcode[dispcount];
if(dispcount==7)
{
P1=P1 | 0x80;
}
dispcount++;
if(dispcount==8)
{
dispcount=0;
}
}
評(píng)論