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

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.