FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 175eb1b8 authored by ayush1301's avatar ayush1301
Browse files

delete the old turn around

parent 656b9127
No related branches found
No related tags found
No related merge requests found
...@@ -409,39 +409,6 @@ float check_ultrasonic_distance(void){ ...@@ -409,39 +409,6 @@ float check_ultrasonic_distance(void){
return US_distance_avg; return US_distance_avg;
} }
/*
int turn_around(int velocity, int side){
// will be called when block collection junction is detected
// velocity and side variables control speed and sense of rotation
// returns 0 if it successfully turns around (i.e. detects junction again.
// Else returns 0 if it continues turning too long without detecting junction
int turn_around_count = 0; //measures time spent turning
rotate(motors, velocity, side); // starts turning both motors to facilitate turning around
delay(200); //small delay to avoid detecting the junction again in the start
while(true){
turn_around_count += 1;
update_IR_vals();
int junction_status = IR_check(IR_colours);
if (junction_status == 3){
Serial.println("Junction detected, turn around completed successfully");
move_both(motors, 0);
for(int j=0; j<2; j++) {
motors[j]->run(regions[0]);
}
return 0;
}
if (turn_around_count > 5000){
Serial.println("Loop Completed, Junction Not Detected");
move_both(motors, 0);
for(int j=0; j<2; j++) {
motors[j]->run(regions[0]);
}
return 1;
}
}
}
*/
int turn_around(int turn_around_time, int turn_around_velocity){ int turn_around(int turn_around_time, int turn_around_velocity){
turn_around_time_start = millis(); turn_around_time_start = millis();
rotate(motors, turn_around_velocity, right); rotate(motors, turn_around_velocity, right);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment