#include <reg52.h>
#include <intrins.h>
#define uchar unsigned char
#define uint unsigned int
void DelayMS(uint x)
{
uchar t;
while(x--)
{
for(t=120;t>0;t--);
}
}
void main()
{
uchar i;
P0=0xFE;
while(1)
{
for(i=7;i>0;i--)
{
P0=_crol_(P0,1);
DelayMS(550);
}
for(i=7;i>0;i--)
{
P0=_cror_(P0,1);
DelayMS(550);
}
}
}
|