|
源程序:
#include <reg52.h>
#include <intrins.h>
#define uchar unsigned char
#define uint unsigned int
uchar i;
uchar temp;
void delay (unit z)
{
uint x,y;
for(x = z; x > 0; x--)
for(y = 120; y > 0 ; y--);
}
void main()
{
temp = 0x7f;
P1 = temp;
while(1)
{
for(i = 0; i < 8; i++)
{
temp = _cror_(temp,1);
P1 = temp;
delay(1000);
}
}
}
錯誤提示:
Build target 'Target 1'
compiling flashled.c...
FLASHLED.C(10): error C141: syntax error near 'z', expected ')'
FLASHLED.C(12): error C141: syntax error near 'x'
FLASHLED.C(12): error C202: 'x': undefined identifier
FLASHLED.C(13): error C202: 'x': undefined identifier
FLASHLED.C(14): error C202: 'y': undefined identifier
|
|