EasyManua.ls Logo

Keyestudio 4WD Bluetooth Multi-functional Car - Page 89

Keyestudio 4WD Bluetooth Multi-functional Car
151 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
keyestudio
www.keyestudio.com
87
{
stopp(); // clear output material
delay(100);
back(); // going backward for 0.2 second
delay(200);
}
if(Fspeedd < 40) // assuming the front distance less than 25cm
{
stopp();
delay(100); // clear output material
ask_pin_L(); // reading out the left distance
delay(delay_time); // waiting servo motor to be stable
ask_pin_R(); // reading out the right distance
delay(delay_time); // waiting servo motor to be stable
if(Lspeedd > Rspeedd) //assuming left distance more than right distance
{
directionn = Lgo; //turning left
}
if(Lspeedd <= Rspeedd) //assuming left distance less than or equal to right distance
{
directionn = Rgo; //turning right
}

Related product manuals