Keywish Hummer-Bot Instruction Manual page 81

Table of Contents

Advertisement

// Special case If the left return distance is greater than 1000, the probe is
blocked and turn right at this moment
}
else if
(dr
>=
{
digitalWrite(M1,180);
analogWrite(E1, 0);
digitalWrite(M2,0);
analogWrite(E2, 180);
Serial.println("Turning
delay(200);
}
else if
(dr
>= 1000)
{
digitalWrite(M1,0);
analogWrite(E1, 180);
digitalWrite(M2,180);
analogWrite(E2, 0);
Serial.println("Turning
delay(200);
// Special case If the return distance on the right is more than 1000, then the
probe is blocked and turn left at this moment
}
else if
(dr
<=
{
digitalWrite(M1,255);
analogWrite(E1, 0);
digitalWrite(M2,0);
analogWrite(E2, 255);
Serial.println("Turning
delay(700);
// turn around if both sides are less than 20cm in distance
}
}
}
In front the sections, we focus on the "automatic driving", and they are obstacle avoidance experiments.
We didn't seem to have relationship with the car, it is lack of fun. So in the next few sections, we will
develop the car from other aspects to make sure that we are able to control the car personally, then we will
20
&&
dr
<=
1000
//the speed value of motorA is 180
//the speed value of motorB is 180
right2");
// Judge about the distance if the right side then turn right
//the speed value of motorA is 180
//the speed value of motorB is 180
left2");
20
&&
dl
<= 20)
//the speed value of motorA is 255
//the speed value of motorB is 255
around");
&&
dr
> dl)
78

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Hummer-Bot and is the answer not in the manual?

Related Products for Keywish Hummer-Bot

Table of Contents

Save PDF