Hallo,

Zitat von
Felix1988
...
Mein problem bzw. meine Frage ist ich habe jetzt mal versucht das Programm was in der Anleitung steht zu übertragen und auf den Asuro zu Flashen aber er fährt nicht los so wie es glaube ich sein sollte oder? Hier ist der Auszug aus dem Programm:
#include "asuro.h"
int main(void){
3: int()
MotorDir(FWD,FWD);
5: MotorSpeed(120;120);
...
8: SerWrite("Alles OK!\n",10);
...
13: SerWrite("Aua!\n",5);
...
}
Ich weiß nicht ob ich was falsch gemacht habe, oder geht das gar nicht mit dem " Programmers Notepad" doch oder?
...
das Programm hat Syntax-Fehler in Zeilen 3 und 5, das dürftest Du so nicht übersetzt gekriegt haben:
Code:
C:\ASURO_src\AsuroLib\work\Simple1>make
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -I../../lib/inc -funsigned-char -fu
nsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahl
ms=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.exe (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.
Size before:
test.elf :
section size addr
.text 1956 0
.data 22 8388704
.bss 21 8388726
.noinit 0 8388747
.eeprom 0 8454144
.stab 8040 0
.stabstr 3174 0
Total 13213
avr-gcc -c -mmcu=atmega8 -I. -g -Os -I../../lib/inc -funsigned-char -funsigned-b
itfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.l
st test.c -o test.o
test.c: In function `main':
test.c:3: error: parse error before ')' token
test.c:5: error: parse error before ';' token
make: *** [test.o] Error 1
In Zeile 3 sollte es Init(); heißen, anstelle von int(), und in Zeile 5 müssen die Argumente von MotorSpeed() mit Komma getrennt sein.
In Zeilen 8 und 13 solltest Du besser \r\n anstelle von \n nehmen, da Du sicher nicht nur eine Zeile nach unten, sondern zum nächsten Zeilenanfang im (Hyper)Terminal möchtest.
Hier der korrigierte Quelltext, Du solltest Quelltext mit [ code ][ / code ] einrahmen:
Code:
#include "asuro.h"
int main(void){
Init();
MotorDir(FWD,FWD);
MotorSpeed(120,120);
StatusLED(GREEN);
while (PollSwitch()==0){
SerWrite("Alles OK!\r\n",11);
}
MotorSpeed(0,0);
StatusLED(RED);
while (1){
SerWrite("Aua!\r\n",6);
}
}
Lesezeichen