Hier das Programm von core duo
Jetzt hier der FehlerCode:#include "asuro.h" int main(void){ Init(); int zeit; unsigned int taste1, taste2; MotorDir(FWD,FWD); MotorSpeed(120,124); StatusLED(GREEN); FrontLED(ON); while (1){ taste1=PollSwitch(); taste2=PollSwitch(); if(taste1 == taste2){ if (taste == 1){ MotorSpeed(0,0); StatusLED(RED); BackLED(ON,ON); MotorDir(RWD,RWD); MotorSpeed(150,151); for(zeit=0;zeit<1000;zeit++){ Sleep(72); } BackLED(OFF,OFF); StatusLED(GREEN); MotorDir(FWD,FWD); MotorSpeed(0,180); for (zeit=0; zeit<415; zeit++){ Sleep(72); } MotorSpeed(120,121); for(zeit=0;zeit<500;zeit++){ Sleep(72); } BackLED(OFF,OFF); StatusLED(GREEN); MotorDir(FWD,FWD); MotorSpeed(180,0); for (zeit=0; zeit<415; zeit++){ Sleep(72); } MotorSpeed(120,121); } else if (taste==32){ MotorSpeed(0,0); StatusLED(RED); BackLED(ON,ON); MotorDir(RWD,RWD); MotorSpeed(150,152); for(zeit=0;zeit<1000;zeit++){ Sleep(72); } BackLED(OFF,OFF); StatusLED(GREEN); MotorDir(FWD,FWD); MotorSpeed(180,0); for (zeit=0; zeit<415; zeit++){ Sleep(72); } MotorSpeed(120,122); for(zeit=0;zeit<500;zeit++){ Sleep(72); } BackLED(OFF,OFF); StatusLED(GREEN); MotorDir(FWD,FWD); MotorSpeed(0,180); for (zeit=0; zeit<415; zeit++){ Sleep(72); } MotorSpeed(120,122); } else if (taste==16 || taste==2){ MotorSpeed(0,0); StatusLED(RED); BackLED(ON,ON); MotorDir(RWD,RWD); MotorSpeed(150,152); for(zeit=0;zeit<1000;zeit++){ Sleep(72); } BackLED(OFF,OFF); StatusLED(GREEN); MotorDir(FWD,FWD); MotorSpeed(0,180); for (zeit=0; zeit<1000; zeit++){ Sleep(72); } MotorSpeed(120,122); } } } while(1); return 0; }
Code: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 In file included from asuro.h:34, from test.c:1: c:/winavr-20090313/lib/gcc/../../avr/include/avr/signal.h:36:2: warning: #warning "This header file is obsolete. Use <avr/interrupt.h>." test.c: In function 'main': test.c:18: error: 'taste' undeclared (first use in this function) test.c:18: error: (Each undeclared identifier is reported only once test.c:18: error: for each function it appears in.) make: *** [test.o] Error 1 > Process Exit Code: 2 > Time Taken: 00:01







Zitieren

Lesezeichen