Programm funktioniert nicht
Hallo, Leute,
ich hab folgendes Problem:
Ich bin Anfänger was Roboter und programmieren betrifft und habe mir letzte Woche einen RP6 gekauft. Nun hab ich ein erstes Programm für den rp6 geschrieben und auch kompiliert:
Code:
#include "RP6RobotBaseLib.h"
void Bumper(void)
{
if(bumper_left)
writeString("Linker Bumper gedrueckt!! \n");
else
if(bumper_right)
writeString("Rechter Bumper gedrueckt!! \n");
else
if(bumper_left && bumper_right)
writeString("Beide Bumper gedrueckt!! \n");
}
int main(void)
{ initRobotBase();
powerON();
writeString("Hallo! \n");
while(true)
Bumper;
return 0;
}
Beim Kompiler kommt folgende Ausgabe:
Code:
-------- begin --------
avr-gcc (GCC) 4.1.2 (WinAVR 20070525)
Copyright (C) 2006 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:
AVR Memory Usage
----------------
Device: atmega32
Program: 6288 bytes (19.2% Full)
(.text + .data + .bootloader)
Data: 215 bytes (10.5% Full)
(.data + .bss + .noinit)
Compiling: RP6Base_LEDs.c
avr-gcc -c -mmcu=atmega32 -I. -gdwarf-2 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=RP6Base_LEDs.lst -I../../RP6lib -I../../RP6lib/RP6base -I../../RP6lib/RP6common -std=gnu99 -MD -MP -MF .dep/RP6Base_LEDs.o.d RP6Base_LEDs.c -o RP6Base_LEDs.o
RP6Base_LEDs.c: In function 'main':
RP6Base_LEDs.c:39: warning: statement with no effect
Linking: RP6Base_LEDs.elf
avr-gcc -mmcu=atmega32 -I. -gdwarf-2 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=RP6Base_LEDs.o -I../../RP6lib -I../../RP6lib/RP6base -I../../RP6lib/RP6common -std=gnu99 -MD -MP -MF .dep/RP6Base_LEDs.elf.d RP6Base_LEDs.o ../../RP6lib/RP6base/RP6RobotBaseLib.o ../../RP6lib/RP6common/RP6uart.o --output RP6Base_LEDs.elf -Wl,-Map=RP6Base_LEDs.map,--cref -lm
Creating load file for Flash: RP6Base_LEDs.hex
avr-objcopy -O ihex -R .eeprom RP6Base_LEDs.elf RP6Base_LEDs.hex
Creating Extended Listing: RP6Base_LEDs.lss
avr-objdump -h -S RP6Base_LEDs.elf > RP6Base_LEDs.lss
Creating Symbol Table: RP6Base_LEDs.sym
avr-nm -n RP6Base_LEDs.elf > RP6Base_LEDs.sym
Size after:
AVR Memory Usage
----------------
Device: atmega32
Program: 6290 bytes (19.2% Full)
(.text + .data + .bootloader)
Data: 215 bytes (10.5% Full)
(.data + .bss + .noinit)
-------- end --------
> Process Exit Code: 0
> Time Taken: 00:01
Die Übersetzung läuft also fehlerfrei ab.
Allerdings: Der Roboter hält sich nicht ganz daran. Er erzeugt nur die Ausgabe "Hallo!" und wenn ich auf den Bumpern herumdrücke, geschieht nichts. Aber warum?
Kann mir jemand weiterhelfen?
Mfg
Michi