www.keyestudio.com
void avoid()
{
distance1=sr04.Distance();
sensor
if((distance1 < 10)&&(distance1 !=
and less than 10
{
car_Stop();//stop
myMatrix.clear();
myMatrix.writeDisplay();//show stop pattern
matrix_display(matrix_stop2);
delay(100);
servopulse(servopin,180);//servo rotates to 180°
delay(200);
distance2=sr04.Distance();//measure the distance
delay(100);
servopulse(servopin,0);//rotate to 0 degree
delay(200);
distance3=sr04.Distance();//measure the distance
delay(100);
//obtain the value detected by ultrasonic
0))//if the distance is greater than 0
//show stop pattern
179
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