Programming Lego Mindstorms NXT

Book description

Teach your robot new tricks! With this projects-based approach you can program your Mindstorms NXT robot to solve a maze, build a house, run an obstacle course, and many other activities. Along the way you will learn the basics of programming structures and techniques using NXT-G and Microsoft VPL.

For hobbyists, and students working on robot projects, Bishop provides the background and tools to program your robot for tasks that go beyond the simple routines provided with the robot kit. The programs range in complexity from simple contact avoidance and path following, to programs generating some degree of artificial intelligence
  • a how-to guide for programming your robot, using NXT-G and Microsoft VPL
  • ten robot-specific projects show how to extend your robot's capabilities beyond the manufacturer's provided software. Examples of projects include: Maze solver, Robot House Builder, Search (obstacle avoidance), Song and Dance Act
  • flowcharts and data flow diagrams are used to illustrate how to develop programs
  • introduces basic programming structures

Table of contents

  1. Copyright
  2. Brief Table of Contents
  3. Table of Contents
  4. List of Figures
  5. List of Tables
  6. Author
  7. Chapter 1. Robots and Programs
    1. Introduction
    2. What is a Program?
    3. Designing a Robot
    4. Summary
  8. Chapter 2. About NXT-G Programs
    1. Introduction
    2. Creating a Program
    3. First Steps
    4. Out of Memory?
    5. Coming for a Spin?
  9. Chapter 3. Data
    1. Introduction
    2. Sources of Data
  10. Chapter 4. Loops
    1. Introduction
    2. Outside Events
    3. Dance Some More
    4. Use Loops to Make Actions Repeat
    5. Logical Conclusions
  11. Chapter 5. Switches and Other Topics
    1. The Switch Block
    2. Switch Blocks Direct Execution Along Alternative Pathways
    3. Diagnostic Programming
  12. Chapter 6. Using the Light Sensor
    1. Introduction
    2. Light Sensor Directed Downward
    3. Lined in
    4. Line Follower
    5. Edge Follower
    6. Light Sensor Directed Forward
    7. Lightfinder1
    8. LightFinder2
    9. LightFinder3
    10. LightFinder4
    11. Summary
  13. Chapter 7. Using the Touch Sensor and the NXT Buttons
    1. Introduction
    2. Waiting for Contact
    3. Scanning the NXT Buttons
    4. Entering Numbers
  14. Chapter 8. Using the Ultrasonic Sensor
    1. Introduction
    2. Avoidance Routine for Alpha Rex
    3. Ultrasonic Search
  15. Chapter 9. Sounds Received and Emitted
    1. Introduction
    2. Start and Stop
    3. Start, Stop, and Turn
    4. One Clap or Two?
    5. Playing a Tune (with a Little Dance)
    6. Choreography
  16. Chapter 10. The Magnetic Compass Sensor
    1. Introduction
    2. Heading in the Right Direction
    3. Polygon
    4. Circle
  17. Chapter 11. More Mathematics
    1. Introduction
    2. Floating Point Arithmetic
    3. Calculating Cosines
    4. Calculating Sines
    5. Square Root
    6. Factorials
    7. Combinations
    8. X modulo Y
    9. Modulo Counting
  18. Chapter 12. Navigation
    1. Introduction
    2. Distance Traveled
    3. Magnetic Compass
    4. No-go Response to a Line
    5. Steering Alpha Rex
    6. Marching Orders
    7. Rex On Line
    8. Rex On Edge
    9. Pathfinder
    10. Cosine Rule
  19. Chapter 13. Games Robots Play
    1. Introduction
    2. Maze Runner—Version 1
    3. Maze Runner—Version 2
    4. Maze Runner—Version 3
    5. Maze Learner
    6. Scissors, Paper, Stone
    7. Signalling by Semaphore
    8. Magic
    9. The Program
  20. Chapter 14. Databases for Robots
    1. Introduction
    2. Lookup Table for Weekdays
    3. Writable Lookup Table
    4. Another Way of Using a Lookup Table
    5. Reading Data from a File Access Block
    6. Acknowledgements
  21. Index
    1. A
    2. B
    3. C
    4. D
    5. E
    6. F
    7. H
    8. I
    9. L
    10. M
    11. N
    12. O
    13. P
    14. Q
    15. R
    16. S
    17. T
    18. U
    19. V
    20. W
    21. X

Product information

  • Title: Programming Lego Mindstorms NXT
  • Author(s): Owen Bishop
  • Release date: April 2011
  • Publisher(s): Syngress
  • ISBN: 9780080569963