这是怎么回事啊?
#include <reg51.h>void delays(unsigned int i);
void main(void)
{
char LED;
LED = 0xfe;
unsigned char i;
unsigned char j;
while(1)
{
for (i = 255; i > 0; i--)
{
P2 = LED;
delays(500);
LED = LED << 1;
LED = LED | 0x01;
if (LED == 0x7f)
break;
}
for (j = 255; j > 0; j--)
{
P2 = LED;
delays(500);
LED = LED >> 1;
LED = LED | 0x80;
}
}
}
void delays(unsigned int i)
{
unsigned char j;
for (i; i > 0; i--)
for (j = 255; j > 0; j--) ;
}
返回
DEMO.C(7): error C141: syntax error near 'unsigned'
DEMO.C(7): error C202: 'i': undefined identifier
DEMO.C(8): error C141: syntax error near 'unsigned'
DEMO.C(8): error C202: 'j': undefined identifier
DEMO.C(11): error C202: 'i': undefined identifier
DEMO.C(19): error C202: 'j': undefined identifier
Target not created