Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

2. Anatomy of Lego Robotics > Programming Your Brick

Programming Your Brick

The default way to program an NXT brick involves NXT-G, a kid-friendly programming environment that uses Lego-like blocks (Figure 2-14) to organize commands. Say you want to run a motor for ten seconds. You drag and drop a Move block from the palette onto your work area and customize its settings. For instance, you could set the Move block to make the motor spin counter-clockwise with 75% power for 10 rotations. The advantage of this graphical interface is that you can immediately start programming without fiddling with a programming language’s syntax.

Rather than employing the text-based interface of most programming languages, NXT-G uses programming blocks
Figure 2-14. Rather than employing the text-based interface of most programming languages, NXT-G uses programming blocks

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint