NXT Using Joysticks
(→Joystick Control - Game) |
|||
| (3 intermediate revisions by one user not shown) | |||
| Line 1: | Line 1: | ||
| − | <yambe:breadcrumb self="Using Joysticks"> | + | <yambe:breadcrumb self="Using Joysticks">TETRIX|TETRIX</yambe:breadcrumb> |
| Line 128: | Line 128: | ||
*Click on the "Joystick Control - Competition" menu option to open the Controller Station | *Click on the "Joystick Control - Competition" menu option to open the Controller Station | ||
|- | |- | ||
| − | |[[File: | + | |[[File:NXT Joystick Competition.png]] |
|- | |- | ||
| − | |As you can see, the window has a few more options than the "Joystick Control - Simple" screen did. | + | |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]] | ||
| Line 138: | Line 138: | ||
|[[File:dual_joystick2.gif]] | |[[File:dual_joystick2.gif]] | ||
|- | |- | ||
| + | |<br /> | ||
| + | |- | ||
| + | |||
|} | |} | ||
<br /> | <br /> | ||
Latest revision as of 14:30, 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








