Thursday, August 27, 2009

NXT 2.0 2-Button Remote Control

The NXT 2.0 kit doesn't come with a handheld remote control (there is a new software one for Bluetooth control from your computer), but it does come with two touch sensors, so you can use them to make some simple wired remote controls. A remote control is useful for several things like prototyping, experimenting, as well as just to have some fun controlling your creations. Also, some creations you build might be partailly autonomous and partially user-interactive, so it is useful to have some remote control programming strategies under your belt.

This NXT 2.0 2-Button Remote Control project is extremely simple mechanically, but the main point is to show some basic strategies for 2-button remote control programming. Two programs are provided, a simple one that just chooses one of four actions depending on the state of the buttons (left, right, both, neither), and a more complex one that adds timers to make driving motions that accelerate smoothly in each direction. More complex or different variations will follow in other projects.

Here is a video of these two programs used to drive the 3-Motor Chassis vehicle:


So what about NXT 1.0? Can you use this stuff too? Yes and No. NXT 1.0 only comes with one touch sensor, but you can easily buy another touch sensor. There is nothing really NXT 2.0-specific about the programs I have posted, but they were created and saved by NXT 2.0. I tried using them on NXT 1.0, and here's what happened. You can open and view them in the 1.X software, but I tried to compile and download to the brick, and I got "Internal Compiler Error". So, you can at least look at them to study how they work, then do something similar in a new 1.X program.

No comments:

Post a Comment