AVR单片机编译出问题
#include<avr/io.h>voiddelayer()intmain(void){/*Replacewithyourapplicationcode*/DDRD|=...
#include <avr/io.h>
void delayer()
int main (void)
{
/* Replace with your application code */
DDRD|=(1<<PD0);
DDRC|=(1<<PC0);
DDRB|=(1<<PB0);
DDRA|=(1<<PA0);
while(1)
{
PORTA|=(1<<PA0);
delayer();
PORTB|=(1<<PB0);
delayer();
PORTC|=(1<<PC0);
delayer();
PORTD|=(1<<PD0);
delayer();
}
}
void delayer ()
{
int i=0;
if (i<500)
{
i=i++;
}
i=0;
}
代码如上
提示四个错误
Severity Code Description Project File Line
Error expected '=', ',', ';', 'asm' or '__attribute__' before '{' token mota test D:\program at\mota test\mota test\main.c 18
Severity Code Description Project File Line
Error expected '=', ',', ';', 'asm' or '__attribute__' before '{' token mota test D:\program at\mota test\mota test\main.c 37
Severity Code Description Project File Line
Error expected '{' at end of input mota test D:\program at\mota test\mota test\main.c 44
Severity Code Description Project File Line
Error recipe for target 'main.o' failed mota test D:\program at\mota test\mota test\Debug\Makefile 76 展开
void delayer()
int main (void)
{
/* Replace with your application code */
DDRD|=(1<<PD0);
DDRC|=(1<<PC0);
DDRB|=(1<<PB0);
DDRA|=(1<<PA0);
while(1)
{
PORTA|=(1<<PA0);
delayer();
PORTB|=(1<<PB0);
delayer();
PORTC|=(1<<PC0);
delayer();
PORTD|=(1<<PD0);
delayer();
}
}
void delayer ()
{
int i=0;
if (i<500)
{
i=i++;
}
i=0;
}
代码如上
提示四个错误
Severity Code Description Project File Line
Error expected '=', ',', ';', 'asm' or '__attribute__' before '{' token mota test D:\program at\mota test\mota test\main.c 18
Severity Code Description Project File Line
Error expected '=', ',', ';', 'asm' or '__attribute__' before '{' token mota test D:\program at\mota test\mota test\main.c 37
Severity Code Description Project File Line
Error expected '{' at end of input mota test D:\program at\mota test\mota test\main.c 44
Severity Code Description Project File Line
Error recipe for target 'main.o' failed mota test D:\program at\mota test\mota test\Debug\Makefile 76 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询