Folgendes Programm macht mir Probleme und ich komm einfach nicht drauf, worans liegt. Der ASURO fährt, wenn er am ersten Hindernis ankommt reagiert er wie gewünscht und beim nächsten Hindernis dreht er sich nur noch . Er stoppt nicht nach dem entsprechenden Winkel und reagiert auch nicht mehr auf die Taster.
pls Help!Code:#include <asuro.h> int main(void) { unsigned char taste; unsigned int i; Init(); Encoder_Init(); MotorSpeed(0,0); while(1) { taste = KeyPressed(); // Funktion hier ausm Forum(https://www.roboternetz.de/phpBB2/ze...ag.php?t=23796) switch(taste) { case 0: //nüschts BackLED(OFF, OFF); StatusLED(GREEN); MotorDir(FWD,FWD); MotorSpeed(150,150); break; case 1: //rechts aussen Turn(-45, 120); BackLED(OFF, ON); break; case 2: //rechts mitte BackLED(OFF, ON); Go(-100, 120); Turn(-30, 120); break; case 4: //rechts innen BackLED(OFF, ON); Go(-100, 120); Turn(-60, 120); break; case 8: //links innen BackLED(ON, OFF); Go(-10, 120); Turn(60, 120); break; case 16: //links mitte BackLED(ON, OFF); Go(-100, 120); Turn(30, 120); break; case 32: //links aussen BackLED(ON, OFF); Turn(45, 120); break; case 18: //rechts & links mitte (2+16) zusammen BackLED(ON, ON); Go(-100, 120); Turn(-90, 120); break; default: MotorSpeed(0,0); for(i=0;i<12;i++) { StatusLED(RED); Sleep(216); StatusLED(OFF); Sleep(216); } BackLED(ON, OFF); Go(-100, 120); Turn(180, 120); break; } } while(1); return 0; }
Thx!







Zitieren

Lesezeichen