Also ich habe ein kleines "Kollisions - zurückfahr - umdreh - weiterfahr" Programm geschrieben und möchte jetzt das Asuro je nach dem wie er sich gestoßen hat verschieden dreht. Jetzt mein Problem: Ich weiß nicht wie ich einzelne Gruppen von Tasten ansprechen soll.
Hier mal das Programm:
Code:
#include "asuro.h"
int main(void)
{
Init();
int t;
MotorDir(FWD,FWD);
MotorSpeed(120,120);
StatusLED(GREEN);
FrontLED(ON);
while (1){
while (PollSwitch()==0) {
SerWrite("Ab die Post!",12);
}
MotorSpeed(0,0);
StatusLED(RED);
MotorDir(RWD,RWD);
MotorSpeed(120,120);
BackLED(ON,ON);
for(t=0;t<1000;t++){
Sleep(72);}
BackLED(OFF,OFF);
MotorDir(FWD,FWD);
MotorSpeed(0,180);
for (t=0; t<1000; t++){
Sleep(72);}
MotorDir(FWD,FWD);
MotorSpeed(120,120);
}
}
An die Leute denen es aufgefallen ist
Ich habe Teile das Programms insbesondere die for - Schleife aus diesem Forum übernommen um mir Anzugucken wie man so ein Programm erstellt.
Lesezeichen