Danke. Jetzt funktioniert es. Zumindest nur ein Teil davon. Ich hab die Kontrolle gleich ganz weggelassen. Wenn ich jetzt aber eine Taste (Tastatur am PC) drücke passiert gar nichts. Und wenn ich dann nochmal eine drücke, wechselt die status LED von grün auf gelb. Danach passiert nichts mehr.
Vielleicht wisst ihr, was da los ist...Code:#include "asuro.h" int main(void) { char msg[2]; { SerRead("b",2,0); msg[1] = '\0'; while(1){ if(msg[0] == 'w') { MotorDir(FWD,FWD); MotorSpeed(255,255); FrontLED(ON); } else if(msg[0] == 's') { MotorDir(RWD,RWD); MotorSpeed(255,255); StatusLED(RED); } else if(msg[0] == 'd') { MotorDir(FWD,FWD); MotorSpeed(255,150); BackLED(OFF,ON); } else if(msg[0] == 'a') { MotorDir(FWD,FWD); MotorSpeed(150,255); BackLED(ON,OFF); } else if(msg[0] == 'x') { MotorDir(FREE,FREE); MotorSpeed(0,0); BackLED(ON,ON); } else {StatusLED(YELLOW);} } return 0;} }







Zitieren

Lesezeichen