#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
uint a,b;
uchar num;
uchar code x[]={
0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x39,0x5e,0x79,0x71};
sbit dula=P2^6;
sbit wela=P2^7;
void delay(uint);
void main()
{ wela=1;
P0=0xc0;
wela=0;
P0=0x00;
while(1)
{for(num=0;num<=15;num++)
{ dula=1;
P0=x[num];
dula=0;
delay(500);};}
}
void delay(uint x)
{ for(a=x;a>0;a++)
for(b=110;b>0;b++);
}
烧写到单片机上 为什么数码管全显示000 000 然后就不动了啊?
此帖出自
小平头技术问答
一周热门 更多>