hi,
ich habe da ein Problem mit ein Programm:
wenn ich das Programm starte dann fährt der Roboter schnell gerade aus,Code:#include "RP6RobotBaseLib.h" int main(void) { initRobotBase(); powerON(); setLEDs(0b001001); DDRA |= (E_INT1); DDRC |= (SCL); int a; setACSPwrMed(); moveAtSpeed(160,160); while(true) { if(getBumperLeft()) { move(85, BWD, DIST_MM(70), true); rotate(70, RIGHT, 50, true); changeDirection(FWD); PORTA |= E_INT1; mSleep(200); PORTA &= ~E_INT1; mSleep(200); PORTA |= E_INT1; mSleep(200); PORTA &= ~E_INT1; } if(getBumperRight()) { move(85, BWD, DIST_MM(70), true); rotate(70, LEFT, 50, true); changeDirection(FWD); PORTC |= SCL; mSleep(600); PORTC &= ~SCL; } if(obstacle_left) { move(85, BWD, DIST_MM(70), true); rotate(70, RIGHT, 60, true); changeDirection(FWD); } if(obstacle_right) { move(85, BWD, DIST_MM(70), true); rotate(70, LEFT, 60, true); changeDirection(FWD); } if(adcBat<600) { for(a = 0;a>10000;a++) { setLEDs(0b010101); mSleep(150); setLEDs(0b101010); } } task_RP6System(); task_motionControl(); task_ADC(); } return 0; }
aber wenn der Roboter auf ein Hinderniss stößt umfäht er es ,aber fährt dann langsammer weiter.Aber warum und wie kann ich das beheben?







Zitieren

Lesezeichen