Hallo,
habe ein kleines problem mit dem Asuro bzw mit der funktion pollswitch.
erstmal mein code
Ich habe ein schwarzes dreieck auf meinen tisch geklebt. Der Asuro fährt diese linie auch wunderbar ab wenn ich pollswitch weglasse. Sobald ich pollswitch einbinde bekomme ich eine zeitverzögerung so dass der Asuro das dreieck nicht mehr korrekt abfährt.Code:int main(void) { unsigned int data[2]; unsigned int stop1=0, stop2=0; unsigned char taste; char daten[8]; Init(); BackLED(OFF,OFF); StatusLED(OFF); FrontLED(ON); MotorDir(FWD,FWD); while (1) { PollSwitch(); LineData(data); if (data[0]>data[1]) { MotorSpeed(130,80); stop1++; if (stop1==1500) { MotorDir(BREAK,BREAK); LineData(data); while (data[1]>50) { LineData(data); //BackLED(ON,ON); MotorDir(FWD,RWD); MotorSpeed(110,130); stop1=0; } MotorSpeed(130,80); MotorDir(FWD,FWD); } stop2=0; } else { MotorSpeed(80,130); stop2++; if (stop2==1500) { MotorDir(BREAK,BREAK); } stop1=0; } } return 0; }
Hat jemand ne idee wie ich das problem beheben kann ?
Grüßc Covel
Lesezeichen