
Make you ideal fun
38
// that's the loop. This is repeatedly called as long as the robot is powered
on
void
loop
()
{
// call function for checking the distance
scan
();
//Serial.println(distance);
if
(
distance
>
1
){
// filters out the zero readings
// an obstacle is being detected
if
(
distance
>
dangerDistance
)
{
// LED at Pin 13 (standard) blinks 5x
led
();
// 4 steps backward left
for
(
int
i
=
0
;
i
<=
3
;
i
++)
{
moveBackRight
();
delay
(
walkSpeed
);
}
// 4 steps forward left
for
(
int
i
=
0
;
i
<=
3
;
i
++)
{
moveTurnLeft
();
delay
(
walkSpeed
);
}
}
else
{
// all clear, no obstacle detected. Just walk forward
moveForward
();
delay
(
walkSpeed
/
100
);
}
}
}
Содержание Insect-Robot
Страница 1: ...Make you ideal fun 1 Insect Robot Instruction Manual...
Страница 9: ...Make you ideal fun 9 Figure 11 Bend the cutted paper into the shape as figure 12 Figure 12...
Страница 11: ...Make you ideal fun 11 Install the Nano board on the servo as figure 15 but don t fix Figure 15...
Страница 27: ...Make you ideal fun 27 Figure 43...
Страница 28: ...Make you ideal fun 28 After adjusting the angle you can completely fix the forefoot Figure 44...