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 Isotope moves or stops. Steer will
control which direction Isotope 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.
Figure 4. Add a variable block to the side of the left arrow switch
where the button is pressed. Set that block to the variable Steer,
and set it to write. Finally, set the value to 100. Recall that "steering"
can be controlled by an integer between -100 and 100: -100 is a full
right turn (it's reversed from a full left turn since Isotope has a gear
train); 100 is a full left turn. When the left arrow is pressed, we'll
ultimately want Isotope to turn left.
Figure 5. Add the same Steer variable block to the right NXT
button switch. This time, set it to -100 for a full right turn.
Figure 3. Add three switches set to "NXT Buttons" for Sensor.
Set the first switch to the left arrow, the second to the right
arrow, and the third to the enter button.
Figure 6. Again, add the Steer variable block to the enter
button switch. This time, set it to 0 to make Isotope go straight
forward when the enter button is pressed.
SERVO 01.2012 75