O'Reilly logo

Mastering Arduino by Jon Hoffman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making things rotate

In Chapter 16, Servo Motors, we saw how we could use a servo motor to open and close a robotic claw; however, a servo motor can do so much more than that. With a servo motor, as we saw with the robotic claw, we can rotate the motor to a specific angle. In the past, I have attached a MaxSonar Range Finder to a servo motor and pointed the sensor straight ahead. Then when the rangefinder detected an object in front of the robot, the servo would turn the rangefinder in different directions, so it could determine the best direction to move in. This enabled me to build an autonomous robot, with obstacle avoidance, using only a single rangefinder.

We could also attach a light source to a servo motor to make a rotating searchlight ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required