初学者 请帮注释下个别地方
#include"at89x51.h"unsigned int j;
unsigned char i,k,cz;
unsigned char a[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x00,0x7c};
unsigned char b[]={0,0,0,0};
unsigned char wx=100;
csh()
{
IE=0x85; //EA=1;EX1=1;EX0=1;
TCON=0x05;//IT0=1;IT1=1;*/
}
bcd()
{ b[0]=10;
b[1]=wx/100;
b[2]=(wx%100)/10;
b[3]=wx%10;
}
tv() 从这里到
{
cz=0xfe;
for(i=0;i<4;i++)
{
k=b[i];
P2=a[k];
P0=cz;
for(j=0;j<550;j++);
cz=(cz<<1)+1; 这里 主要是这个tv函数有些不懂
}
}
void main(void)
{ csh();
while(1)
{
bcd();
tv();
}
}
KINT0() interrupt 0
{wx=wx+1;
if(wx>=120){wx=120;}
}
KINT1() interrupt 2
{wx=wx-1;
if(wx<80)wx=80;
}