不知道你的问题在哪,我用你的也不行,但把自己的改成你的样式依然可以。。。#include<reg52.h>
#include<intrins.h>
#define uint unsigned int
#define uchar unsigned char
uchar temp;
uint temp1;
uchar i;
void delay(int a);
void main()
{
P2=0xfe;
temp1=0x7f;
while(1)
{
for(i=0;i<8;i++)
{
//P2=temp;
P2=_crol_(P2,1);
delay(50);
}
for(i=0;i<8;i++)
{
//P2=temp1;
P2=_cror_(P2,1);
delay(50);
//P2=temp;
}
}
}
void delay(int a)
{
uint x,y;
for(x=a;x>0;x--)
for(y=100;y>0;y--);
} |