Figure 7. Add a variable block to the end of the program and
set it to the Steer variable. Next, find and add a Send Message
block to the end of the program from the Actions menu. Set
the connection number to 1, the message to logic, and the
mailbox to 1. Wire the value from the variable block to the
number data hub on the Send Message block. You'll have to
connect the two NXTs via Bluetooth manually, at which point
you choose the connection number. The mailbox number is
where the data is sent, and we'll later use it to tell Isotope
where to look for those important variables.
Download the control program to your controller, and
the bot program to your robot. Then, connect them via
Bluetooth (make sure both NXTs are set to visible so they
can find each other!). Once you’ve conected them via
Figure 8. Add a variable block and set it to the Stop variable.
Add another Send Message block, and this time set it to
connection port 1, message "Number," and mailbox 2. This time,
connect the value from the variable block to the logic data hub
on the Send Message block.
Bluetooth, test your program. If all goes well, Isotope
should now respond to your button inputs.
Next month, we’ll complete this program by adding
actuator control. SV
Bot Test Program Instructions
Figure 1. Create a new program called BT_Bot_Test. Define a
number variable called Steer and a logic variable called Stop.
These are the same variables from the control program.
Figure 2. Add a loop. Inside the loop, add a Receive Message
block from the Sensors tab. Set the mailbox to 1, and set it to
the Number Out data hub to write to a Steer variable block.
76 SERVO 01.2012