hasibkyau / MazeRunner

2 stars 0 forks source link

Motor Control: Choose Path #5

Open hasibkyau opened 1 year ago

hasibkyau commented 1 year ago
hasibkyau commented 1 year ago

Solved!

void goRight() {

LeftMotor.setSpeed(SPEED);
RightMotor.setSpeed(SPEED);
delay(200);

LeftMotor.forward();
RightMotor.backward();
LeftMotor.setSpeed(SPEED-10);
RightMotor.setSpeed(SPEED-10);

if(front<25){ 
    while(front<25){
        readSonar();
        DisplayStatus();
    } 
}

else{     

    while(left<25){
      readSonar();
      DisplayStatus();
    }

}

}