habe jetzt auch noch das 2. programm fertig gemacht. bin mir aber nicht sicher was nach SerRead in die Klammer muss. Daten ist klar, aber dann? muss da vielleicht fall1, fall2, fall3, fall4 rein??hab nur noch paar warnings drin. errors ist nichts. blos das wichtige ist, kann das so überhaupt funktionieren??
Code:
#include <inttypes.h>
#include "asuro.h"
#define aus MotorDir(BREAK,BREAK)
void main()
{
char daten;
Init();
while(1)
{
SerRead(&daten,1,0); /*Daten einlesen*/
if (daten == 'fall1') /*Falls 1. Fall*/
{
MotorDir(FWD,FWD); /*Gerade aus fahren*/
MotorSpeed(50,50);
Msleep(100);
}
break;
if (daten == 'fall2') /*Falls 2. Fall*/
{
MotorDir(RWD,RWD); /*Rückwärtsfahren*/
MotorSpeed(50,50);
Msleep(100);
}
break;
if (daten == 'fall3') /*Falls 3. Fall*/
{
MotorDir(FWD,FWD); /*Links fahren*/
MotorSpeed(50,0);
Msleep(100);
}
break;
if (daten == 'fall4') /*Falls 4. Fall*/
{
MotorDir(FWD,FWD); /*Rechts fahren*/
MotorSpeed(0,50);
Msleep(70);
}
break;
}
}
../ASUROPlatine.c:15: warning: return type of 'main' is not 'int'
../ASUROPlatine.c: In function 'main':
../ASUROPlatine.c:21: warning: pointer targets in passing argument 1 of 'SerRead' differ in signedness
../ASUROPlatine.c:23:25: warning: character constant too long for its type
../ASUROPlatine.c:31:25: warning: character constant too long for its type
../ASUROPlatine.c:39:25: warning: character constant too long for its type
../ASUROPlatine.c:47:25: warning: character constant too long for its type
../ASUROPlatine.c: At top level:
C:\asuro_libv271\lib\inc/asuro.h:449: warning: inline function 'MotorSpeed' declared but never defined
C:asuro_libv271\lib\inc/asuro.h:441: warning: inline function 'MotorDir' declared but never defined
C:\asuro_libv271\lib\inc/asuro.h:424: warning: inline function 'FrontLED' declared but never defined
C:\asuro_libv271\lib\inc/asuro.h:418: warning: inline function 'StatusLED' declared but never defined
C:\asuro_libv271\lib\inc/asuro.h:449: warning: inline function 'MotorSpeed' declared but never defined
C:\asuro_libv271\lib\inc/asuro.h:441: warning: inline function 'MotorDir' declared but never defined
C:\asuro_libv271\lib\inc/asuro.h:424: warning: inline function 'FrontLED' declared but never defined
C:\asuro_libv271\lib\inc/asuro.h:418: warning: inline function 'StatusLED' declared but never defined
avr-gcc.exe -I"
C:\asuro_libv271\lib\inc" -mmcu=atmega8 -Wall -gdwarf-2 -Os -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enu
ms -MD -MP -MT asuro.o -MF dep/asuro.o.d -c ../../asuro.c
C:\asuro_libv271\lib\inc/asuro.h:449: warning: inline function 'MotorSpeed' declared but never defined
C:\asuro_libv271\lib\inc/asuro.h:441: warning: inline function 'MotorDir' declared but never defined
C:\asuro_libv271\lib\inc/asuro.h:424: warning: inline function 'FrontLED' declared but never defined
C:\asuro_libv271\lib\inc/asuro.h:418: warning: inline function 'StatusLED' declared but never defined
C:\asuro_libv271\lib\inc/asuro.h:449: warning: inline function 'MotorSpeed' declared but never defined
C:\asuro_libv271\lib\inc/asuro.h:441: warning: inline function 'MotorDir' declared but never defined
C:\asuro_libv271\lib\inc/asuro.h:424: warning: inline function 'FrontLED' declared but never defined
C:\asuro_libv271\lib\inc/asuro.h:418: warning: inline function 'StatusLED' declared but never defined
Lesezeichen