Hier ist mal ein Programm von mir da reagiert er auch auf den Bumper:
Code:#include "RP6RobotBaseLib.h" int main(void) { initRobotBase(); powerON(); setLEDs(0b001001); int a; setACSPwrMed(); moveAtSpeed(160,160); while(true) { if(getBumperLeft()) { move(85, BWD, DIST_MM(70), true); rotate(70, RIGHT, 50, true); changeDirection(FWD); moveAtSpeed(160,160); } if(getBumperRight()) { move(85, BWD, DIST_MM(70), true); rotate(70, LEFT, 50, true); changeDirection(FWD); moveAtSpeed(160,160); } if(obstacle_left) { move(85, BWD, DIST_MM(70), true); rotate(70, RIGHT, 60, true); changeDirection(FWD); moveAtSpeed(160,160); } if(obstacle_right) { move(85, BWD, DIST_MM(70), true); rotate(70, LEFT, 60, true); changeDirection(FWD); moveAtSpeed(160,160); } if(adcBat<600) { for(a = 0;a>10s00;a++) { setLEDs(0b010101); mSleep(150); setLEDs(0b101010); } } task_RP6System(); task_motionControl(); task_ADC(); } return 0; }







Zitieren

Lesezeichen