Keyestudio Ks0428 Manual page 238

Table of Contents

Advertisement

www.keyestudio.com
distance = checkdistance(); //assign the distance detected by
ultrasonic sensor to distance
if (distance >= 20 && distance <= 60) //the range to go front
{
Car_front();
}
else if (distance > 10 && distance < 20) //the range to stop
{
Car_Stop();
}
else if (distance <= 10) // the range to go back
{
Car_back();
}
else //other situations, stop
{
Car_Stop();
}
if (Serial.available())
{
bluetooth_val = Serial.read();
if (bluetooth_val == 'S')
{
238

Advertisement

Table of Contents
loading

Table of Contents