#include<reg52.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
uchar code
time[]={0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39};
uchar timeb,datab,flag,a;
void delayms(uint z)
{
uint x,y;
for(x=0;x<z;x++)
for(y=0;y<110;y++);
}
void start()
{
TMOD=0x20;
TH1=0xfd;
TL1=0xfd;
TR1=1;
ET1=1;
SCON=0x50;
ES=1;
EA=1;
}
void main()
{
uchar i,b;
start();
b=1;
while(1)
{
for(i=0;i<10;i++)
{
SBUF=time
;
while(!TI);
TI=0;
}
while(b); //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 写入C51中后,程序为什么在这里停不下来啊,如果直接把b换成1就能停下来
delayms(100);
}
}
[qq]469774574[/qq] 本人比较笨 基础也不好 希望 大家能帮帮忙啊 ~~
一周热门 更多>