#include<reg52.h>
#include <intrins.h>
#define unit unsigned int;
#define uchar unsigned char;
uchar temp;
unit i,j;
void delay();
void main();
{ while(1)
{ for(i=0;i<8;i++)
{temp=0xfe;
P1=temp;
temp= _crol_(temp,1);
delay(600);
P1=temp;
}
for(j=0;j<8;j++)
{temp=0x7f;
P1=temp;
temp= _cror_(temp,1);
delay(600);
P1=temp;
}
}
}
void delay(unit z)
{ unit x,y;
for{x=100;x>0;x--}
for{y=z;y>0;y--};
}
Build target 'Target 1'
compiling 流水灯.c...
流水灯.C(9): error C141: syntax error near '{'
流水灯.C(9): error C141: syntax error near '1'
流水灯.C(10): error C141: syntax error near '=', expected ')'
流水灯.C(10): error C129: missing ';' before '<'
Target not created
|