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 ...
Get Make an Arduino-Controlled Robot now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.