www.keyestudio.com
r_val =
digitalRead(sensor_r);//read the value of right line tracking sensor
if(c_val ==
1)//if the state of middle one is 1, which means detecting
black line
{
front();//car goes forward
}
else
{
if((l_val == 1)&&(r_val ==
detects black trace
{
left();//car turns left
}
else if((l_val == 0)&&(r_val ==
detects black trace
{
right();//car turns right
}
0))//if only left line tracking sensor
1))///if only right line tracking sensor
162
Need help?
Do you have a question about the Smart Little Turtle Robot V3 and is the answer not in the manual?
Questions and answers