Hallo Roboterfreaks O:)
Habe mir vor kurzem einen ASURO zugelegt und bin total gefesselt.
Heute hab ich mich daran gemacht meinen ersten Quellcode für den ASURO zu tippen. Es hagelte immer wieder Errors trotz! abspeicherns vor dem kompilieren! (Der Quellcode war 100% richtig und flashen funktionierte auch reibungslos)
Einmal hat es i-wie durch Zufall geklappt aber danach nie wieder -.-
Nach 4 stunden ausprobierens hab ich mich entschlossen hier mein prob zu posten.
Also hier mein Quellcode:
Ich hatte vor dass der ASURO gerade aus fährt bis er auf ein Hindernis prallt, dann sollte er sich nach links drehen und wieder gerade aus fahren.Code:#include "asuro.h"
int main(void) {
Init()
MotorDir(FWD,FWD);
MotorSpeed(10,10);
while (1) {
if (PollSwitch()>0) {MotorDir(OFF,FWD);}
else {MotorDir(FWD,FWD);}
}
}
Jedoch hagelt es immer wieder errors -.-
Hier sind sie:
C:\Programme\ASURO_src\FirstTry>make all
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test.d; \
[ -s test.d ] || rm -f test.d
-------- begin --------
avr-gcc --version
avr-gcc (GCC) 3.3.1
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c -o test.o
test.c: In function `main':
test.c:7: error: parse error before "while"
test.c:11:2: warning: no newline at end of file
make: *** [test.o] Error 1
> Process Exit Code: 2
Es kommen andauernd i-welche nervigen parse... fehler :'(
Könnt ihr mir vll helfen meinen ASURO zum fahren zu bringen?
DANKE an alle Antworten!
MFG Kieselstein