Hi, ich würde etwas an den klammern in den bedingungen verändern:
Code:
#include "RP6RobotBaseLib.h"
int main(void)
{
initRobotBase();
powerON();
setACSPwrMed();
task_ACS();
task_ADC();
while ((obstacle_left < 1) && (obstacle_right < 1) && (bumper_left == 0) && (bumper_right == 0))
{
task_motionControl();
moveAtSpeed(50,50);
}
while ((obstacle_left) > (obstacle_right))
{
task_motionControl();
moveAtSpeed(75,10);
}
while ((obstacle_right) > (obstacle_left))
{
task_motionControl();
moveAtSpeed(10,75);
}
while ((obstacle_left>0) && (obstacle_right>0))
{
task_motionControl();
moveAtSpeed(-70,-70);
}
}
LG Pr0gm4n
Lesezeichen