#include "STC15F2K60S2.H"
#include <intrins.h>
void Delay100ms() //@11.0592MHz
{
unsigned char i, j, k;
i = 5;
j = 52;
k = 195;
do
{
do
{
while (--k);
} while (--j);
} while (--i);
}
void main()
{
//Y4 P27 P26 P25 1 0 0
unsigned char temp=0x01;
unsigned char LED;
unsigned char i;
P0 = 0;
P27 = 1;
P26 = 0;
P25 = 1;
P27 =0;
P26 =0;
P25 =0;//锁存
while(1)
{
temp=_crol_(temp,1);//左移
P0=~temp;
P27 =1;
P26 =0;
P25 =0;
P27 =0;
P26 =0;
P25 =0;//锁存
Delay100ms();
}
/*
for(i=0;i<=8;i++)
{
P0=~temp;
temp = temp<<1;
Delay100ms();
P27 =1;
P26 =0;
P25 =0;
P27 =0;
P26 =0;
P25 =0;//锁存
}
temp=0x01;
}
*/
}
|