新手!晶体管显示数字一到九,间隔一秒,用中断实现

2019-07-15 21:49发布

#include<reg51.h>
#define LEDPort P0
unsigned char a;
unsigned char DisCA[10]={0xC0,0xF9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
unsigned char DisCC[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};

void         T0_ISR() interrupt 1
{

TH0=15536/256;
TL0=15536%256;
a=0;
if(a==20)
{
unsigned char i=0;
for(i=0;i<10;i++)
{
LEDPort=DisCC[i];
}
a++;
}
}
void main()
   {
TMOD=0X01;
  TH0=15536/256;
  TL0=15536%256;
  EA=1;
ET0=1;
TR0=1;
while(1);
}
哪里错了??

友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。