www.keyestudio.com
if(distance2 > distance3)//compare the distance, if left distance is
more than right distance
{
car_left();//turn left
myMatrix.clear();
myMatrix.writeDisplay();
matrix_display(matrix_left2);
servopulse(servopin,90);//servo rotates to 90 degree
//delay(50);
myMatrix.clear();
myMatrix.writeDisplay();
matrix_display(matrix_front2);
}
else//if the right distance is greater than the left
{
car_right();//turn right
myMatrix.clear();
myMatrix.writeDisplay();
matrix_display(matrix_right2);
servopulse(servopin,90);//servo rotates to 90 degree
//delay(50);
myMatrix.clear();
//display left-turning pattern
//show forward pattern
//display right-turning pattern
180
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