Figure 2. Next, we're going to recreate the portions of our
program dedicated to calibrating the Y axis, and switch the
variables to our X variables and sensor port to four for our
second gyro sensor.
Figure 3. Select all of the blocks inside of the final loop in the
program. Hold Ctrl, and click and drag the blocks up and out of
the loop, creating a duplicate of those blocks that will be saved
Figure 4. Finally, switch all of the Y variables in the loop to
their X variable components, and switch the reference
to the gyro sensor on port 3 to port 4.
Making the Controller
Now that we’ve got the majority of our programming
done for Eddie’s gyro controller, let’s put together the
physical controller in a way that we can use it.
Go ahead and test your program again after
completing the instructions. When you hold the NXT and
swing it left and right, you should see the number
displayed on the LCD increase and decrease.
Gyro Controller Build Instructions
Start with the pins indicated.
the NXT as
Attach the gyro
sensor on its side
to port 3, and
the other sensor
to port 4.
Sending the Numbers
two Hi Technic
Now that we’ve programmed both of our gyro sensors for Eddie’s
controller, we need to send that data to Eddie so he can interpret it and
change the numbers into movement. Start by saving Gyro_Test_ 4 as
Gyro_Control_Test so you have a backup. Then, follow these instructions:
SERVO 08.2011 71