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

timers

The NXT has three built-in timers that act like stopwatches. You can use a timer to tell you how long your program has been running or to measure how long it takes the robot to perform a particular task. Typically using a timer is a two-step process: You reset the timer to 0 before beginning a task, and then read the timer when the task is complete. Think of a timer as a kind of sensor for time.

Like a stopwatch, a timer can be used for a variety of purposes. For example, you can do any of the following:

  • Time how long it takes your entire program to run and use that information to fine-tune parts of your program. For example, you might measure how long it takes your robot to solve a maze and then use that information to find the fastest solution. ...

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