FAQ | This is a LIVE service | Changelog

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

Deposit block code

parent f39f3b7d
No related branches found
No related tags found
No related merge requests found
......@@ -184,11 +184,26 @@ void loop() {
Serial.println("NOT DETECTED");
}
turn_around(turn_around_time, 255);
turn_around(turn_around_time, 255, right);
region += 1;
}
else {
Serial.println("REGION 3 bois");
if (is_metal) {
turn_around(turn_around_time/2, 255, right);
}
else {
turn_around(turn_around_time/2, 255, left);
}
bring_down_servos(110);
if (is_metal) {
turn_around(turn_around_time/2, 255, left);
}
else {
turn_around(turn_around_time/2, 255, right);
}
region += 1;
move_both(motors, 0);
while(1);
}
}
......@@ -407,9 +422,9 @@ float check_ultrasonic_distance(void){
return US_distance_avg;
}
int turn_around(int turn_around_time, int turn_around_velocity){
int turn_around(int turn_around_time, int turn_around_velocity, int side){
turn_around_time_start = millis();
rotate(motors, turn_around_velocity, right);
rotate(motors, turn_around_velocity, side);
while(true){
turn_around_time_end = millis();
if (turn_around_time_end > turn_around_time_start + turn_around_time){
......
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