Keyestudio Smart Little Turtle Robot V3 Manual page 180

Table of Contents

Advertisement

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

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents