Chapter 10. Autonomous Movement
This chapter describes how to use a distance sensor to enable the robot to see and avoid
obstacles as it moves around. The first sketch, named myRobotWander, drives
the robot forward, and if it detects an obstacle, it stops and rotates the robot to try and
find a clear path to move forward. Another sketch, named myRobotScan, adds
a servo that can rotate the sensor so the robot can look left and right without having to
twist itself around.
Hardware Required
Ping distance sensor from Parallax; see Sonar Distance Sensors in Chapter 8, Tutorial: Introduction to Sensors.
Servo required for myRobotScan; see Sonar Distance Sensors in Chapter 8, Tutorial: Introduction to Sensors.
Connect the Ping sensor and servo the right ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access