O'Reilly logo

Programming Lego Mindstorms NXT by Owen Bishop

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

Chapter 8. Using the Ultrasonic Sensor

Introduction

Like the light sensor, the ultrasonic sensor is useful for detecting objects that are some distance away from the robot. However, unlike the touch sensor, the ultrasonic sensor does not rely on physical contact. The distance gives more space in which to respond. Generally, the ultrasonic sensor is used for distances of 10 centimeters or more, whereas the light sensor is used at shorter distances.

Programs that employ the light sensor can be adapted to use with the ultrasonic sensor. For instance, you can use the ultrasonic sensor to scan the room for nearby objects.

The ultrasonic sensor can be used for detecting and avoiding objects. Programs for wheeled buggies like QuickStart are easily ...

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