Keyestudio 4WD Bluetooth Multi-functional Car Manual page 90

Hide thumbs Also See for 4WD Bluetooth Multi-functional Car:
Table of Contents

Advertisement

if (Lspeedd < 15 && Rspeedd < 15)
{
directionn = Bgo;
}
}
else
{
directionn = Fgo;
}
}
void ask_pin_F()
// measuring the front distance
{
myservo.write(90);
digitalWrite(outputPin, LOW);
delayMicroseconds(2);
digitalWrite(outputPin, HIGH); // ultrasonic launching high voltage at 10μs,at least at10μs
delayMicroseconds(10);
digitalWrite(outputPin, LOW);
float Fdistance = pulseIn(inputPin, HIGH); // time of error reading
Fdistance= Fdistance/5.8/10;
Fspeedd = Fdistance;
}
void ask_pin_L()
// measuring left distance
{
myservo.write(5);
keyestudio
//assuming both left distance and right distance less than 10cm
//going backward
//assuming the front distance more than 25 cm
//going forward
// ultrasonic launching low voltage at 2μs
// keeping ultrasonic launching low voltage
// converting time into distance(unit:cm)
// reading-in Fspeedd(fore speed) with distance
www.keyestudio.com
88

Advertisement

Table of Contents
loading

Related Products for Keyestudio 4WD Bluetooth Multi-functional Car

Table of Contents