Get ready to get busy, as we learn just how much
programming has to go into both the remote control and
the robot itself to make it go.
We’ll need two things before we get started
- A fully-built Eddie 2.0; you can find Eddie 2.0 building
instructions in the January ‘ 11 edition.
Understanding The Program
As I said before, there are two components going into
The first component is the remote control. It takes your
input from pressing buttons, translates it into something
Eddie can read, and sends it to him over Bluetooth.
The second component is Eddie. Eddie listens for the
messages from the controller, and uses the variables sent to
it to determine whether or not to move, and which
direction to move in.
Figure A shows the flow of information in a bit more
Writing The Control Program
Now that we understand how the programs work, let’s start by writing the program for the remote control.
Control Test Program Instructions
Figure 1. Start by creating a new program called
BT_Control_Test. Then, click Edit > Manage Variables.
Add a logic variable called STOP, and a number variable
called Steer. Stop will control whether Eddie moves or stops.
Steer will control which direction Eddie moves.
Figure 2. Add a loop. Inside the loop, drag a touch sensor
block in. Add a variable block and choose the Stop variable.
Set the variable to write instead of read. Finally, wire the
output of the touch sensor block to the input of the variable
block. This means that when the touch sensor is pressed, Stop
will be set to true.
SERVO 06.2011 63