Keywish Hummer-Bot-1.0 Instruction Manual page 77

Table of Contents

Advertisement

Serial.println("Turning
delay(200);
analogWrite(M1, 0);
analogWrite(E1, 0);
analogWrite(M2, 0);
analogWrite(E2, 0);
//delay(1000); //********************************************//Turning right
}
if
((left
>= 38) &&
analogWrite(M1, 0);
analogWrite(E1, 250);
digitalWrite(M2, HIGH);
analogWrite(E2, 0);
Serial.println("Turning
delay(200);
analogWrite(M1, 0);
analogWrite(E1, 0);
analogWrite(M2, 0);
analogWrite(E2, 0);
// delay(1000); //********************************************//Turning left
}
else if
(da
<= 25)
{/* The collected value is judged, da <= 25, meaning that when the current obstacle
and the car is less than 20cm, execute the following program in {}, the distance between the car and
the obstacle has exceeded the safety value, So the car stopped forward */
int
val
= 0;
digitalWrite(M1, 0);
analogWrite(E1, val);
digitalWrite(M2, 0);
analogWrite(E2, val);
Serial.print("Distance =
Serial.print(da);
Serial.print("
Serial.println("Stopped");// If the distance is less than 20cm, the car will stop and output
"Stopped"
delay(500);
head.write(180);/* Servo rotated 90 degrees from the original to 180 degrees, the left side of
the car */
delay(1000);
analogWrite(TrigPin, 0);
delayMicroseconds(2);
analogWrite(TrigPin, 255);
delayMicroseconds(10);
analogWrite(TrigPin, 0);
dl
= pulseIn(EchoPin, HIGH) / 58.0;
right");
(right
<= 38) &&
(da
//the speed value of motorA is 180
//the speed value of motorB is 180
left");
//the speed value of motorA is 0
//the speed value of motorB is 0
");
");
// Low high and low send a short pulse to TrigPin
// Convert the echo time to cm
>=
30
&&
da
<= 1000)) {
74

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Subscribe to Our Youtube Channel

Related Products for Keywish Hummer-Bot-1.0

Table of Contents