Skip to Main Content
The Art of LEGO MINDSTORMS NXT-G Programming
book

The Art of LEGO MINDSTORMS NXT-G Programming

by Terry Griffin
August 2010
Intermediate to advanced content levelIntermediate to advanced
288 pages
13h 21m
English
No Starch Press
Content preview from The Art of LEGO MINDSTORMS NXT-G Programming

the rotation sensor

Each NXT motor has a Rotation Sensor built into it that measures how far the motor has turned. You can use this sensor to control how far the robot moves as an alternative to the Move block’s Duration setting. This gives you an easy way to make the program perform certain actions while the robot is moving. For example, you’ll change the BumperBot program to make the TriBot beep while backing up.

While your program is running, the Rotation Sensor tracks how far the motor has moved. You can read this value at any time, the same way you read values from the other sensors. You can also reset the Rotation Sensor value to 0, allowing you to measure how far the motor has moved between any two points in the program. (In most cases, ...

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.
Start your free trial

You might also like

The Art of LEGO MINDSTORMS EV3 Programming (Full Color)

The Art of LEGO MINDSTORMS EV3 Programming (Full Color)

Terry Griffin

Publisher Resources

ISBN: 9781593272180Errata