#include<reg52.h>
#define uint unsigned int
#define uchar unsigned char
void initial(void);
uchar num,co;
uchar a[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
main()
{
initial();
while(1);
}
void initial(void) //初始化
{
P1=0xfe;
co=0;
num=0;
TMOD= 0x01;
TH0=(65536-10)/256;
TL0=(65536-10)%256;
EA=1;
ET0=1;
TR0=1;
}
void timeT0() interrupt 1
{
TH0=(65536-10)/256;
TL0=(65536-10)%256;
num++;
if(num==1)
{ co++;
num=0;
P1=a[co];
if(co==8)
co=0;
}
}
求教高手
歡迎光臨 (http://www.torrancerestoration.com/bbs/) | Powered by Discuz! X3.1 |