NXT Using Joysticks
(→Joystick Control - Competition) |
(→Joystick Control - Competition) |
||
| Line 130: | Line 130: | ||
|[[File:NXT Joystick Competition.png]] | |[[File:NXT Joystick Competition.png]] | ||
|- | |- | ||
| − | |As you can see, the window has a few more options than the "Joystick Control - Simple" screen did. The radio buttons under 'Mode' simulate the different stages in the competition. The debugger window also allows you to choose which tele-op program on the NXT you would like to use. This | + | |As you can see, the window has a few more options than the "Joystick Control - Simple" screen did. The radio buttons under 'Mode' simulate the different stages in the competition. The debugger window also allows you to choose which tele-op program on the NXT you would like to use. This helps make testing your program combinations quick and effective. |
|- | |- | ||
|[[File:single_joystick_game2.gif]] | |[[File:single_joystick_game2.gif]] | ||
Revision as of 14:24, 11 September 2012
| For ROBOTC Joystick NXT functions, check out the NXT Joystick Functions page!
|
|
Joystick Control
| ROBOTC supports using Logitech USB joystick controllers to drive your NXT over the USB or Bluetooth communication link. This allows the user to send commands to their robot in real time, rather than having only pre-programmed behaviors.The joystick functionality works by taking data from the joystick controller and sends it to the NXT over the debugger link as a single message.
getJoystickSettings(joystick); |
#include "JoystickDriver.c" // Tells ROBOTC to include the driver file for the joystick. task main() { while(true) { getJoystickSettings(joystick); // Update Buttons and Joysticks motor[motorC] = joystick.joy1_y1; motor[motorB] = joystick.joy1_y2; } } |
Buttons
Joystick Control - Simple
Joystick Control - Competition








