#include<reg51.h>
#define uchar unsigned char
uchar times,cnt;
uchar led[]={0x00,0xff,0xfe,0xfc,0xf8,0xf0,0xe0,0xc0,0x80,0x00,0xff};
void t0isr() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
times++;
if(times>=40)
{
times=0;
P0=led[cnt];
cnt++;
cnt%=11;
}
}
main()
{
TMOD=0x01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
TR0=1;
ET0=1;
EA=1;
while(1);
}
//ç¨åºå¾ç®åï¼ä½ èªå·±å 注éåå®æå
¶ä»å·¥ä½å§ã
温馨提示:内容为网友见解,仅供参考