#include<reg51.h>
#include <intrins.h>
#define unc unsigned char
#define unt unsigned int
/*unc code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,
0x7d,0x07,0x7f,0x6f};
sbit duan=P1^0;
sbit wei=P1^1;*/
sbit liu=P0;
void delay(unt);
void init();
void main()
{
init();
while(1)
{
liu=_crol_(liu,1);
P0=liu;
delay(1000);
}
}
void delay(unt e)
{
unt x,y;
for(x=e;x>0;x--)
{
for(y=110;y>0;y--);
}
}
void init()
{
liu=0xfe;
}
为什么我这个程序流水灯不会流呢?望解答,谢谢! |