NXT Using Joysticks
(→Joystick Control - Simple) |
|||
| (10 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 5: | Line 5: | ||
|- | |- | ||
|''For ROBOTC Joystick NXT ''functions'', check out the [[NXT_Functions_Joystick_Control|NXT Joystick Functions]] page!'' | |''For ROBOTC Joystick NXT ''functions'', check out the [[NXT_Functions_Joystick_Control|NXT Joystick Functions]] page!'' | ||
| + | |||
| + | |||
| + | ROBOTC has built two different Joystick Controller stations built into the interactive debugger. "Joystick Control - Simple" is a debugger window to control the NXT via a Logitech USB remote control. "Joystick Control - Game" is a full featured Controller Station which is used mainly for FIRST Tech Challange or other competitions that are NXT or TETRIX based. | ||
|- | |- | ||
|} | |} | ||
| − | |||
| − | + | ||
| + | {{tl|1|}} | ||
| Line 99: | Line 102: | ||
| − | ROBOTC will send joystick data to your NXT over Bluetooth or USB, but only when the Joystick Control window is opened. You will need to have the debugger open to use the Joystick Station. | + | ROBOTC will send joystick data to your NXT over Bluetooth or USB, but only when the Joystick Control window is opened. '''You will need to have the debugger open to use the Joystick Station'''. |
|- | |- | ||
|[[File:single_joystick2.gif]] | |[[File:single_joystick2.gif]] | ||
| Line 106: | Line 109: | ||
<br /> | <br /> | ||
| − | == Joystick Control - | + | == Joystick Control - Competition== |
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;" width="100%" cellpadding="5%" cellspacing="0" border="0" | {| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;" width="100%" cellpadding="5%" cellspacing="0" border="0" | ||
|- | |- | ||
| Line 115: | Line 118: | ||
*Go to the "Window" menu | *Go to the "Window" menu | ||
*Choose the "Menu Level" sub-menu | *Choose the "Menu Level" sub-menu | ||
| − | *Click on the "Expert" menu option | + | *Click on the "Expert" or "Super User" menu option |
|- | |- | ||
| − | |[[File: | + | |[[File:NXT Joystick Level.png]] |
|- | |- | ||
| − | |After setting the Menu Level to "Expert", you can then access the "Joystick Control - Game" station by: | + | |After setting the Menu Level to "Expert" or "Super User", you can then access the "Joystick Control - Game" station by: |
*Downloading your program and starting the debugger | *Downloading your program and starting the debugger | ||
*Going to the "Robot" menu | *Going to the "Robot" menu | ||
*Choose the "Debug Windows" sub-menu | *Choose the "Debug Windows" sub-menu | ||
| − | *Click on the "Joystick Control - | + | *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 135: | 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








