Keyestudio Smart Little Turtle Robot V3 Manual page 170

Table of Contents

Advertisement

www.keyestudio.com
if(distance<8)//if distance is less than 8
{
back();//go back
}
else
if((distance>=8)&&(distance<13))//if 8≤distance<13
{
Stop();//stop
}
else
if((distance>=13)&&(distance<35))//if 13≤distance<35
{
front();//follow
}
else//otherwise
{
Stop();//stop
}
}
void front()//define the status of going front
{
digitalWrite(left_ctrl,LOW);
analogWrite(left_pwm,200);
170

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents