NXT Using Joysticks
(Created page with "<yambe:breadcrumb self="Using Joysticks">NXT|NXT</yambe:breadcrumb> {| class="wikiText" |- |''For ROBOTC Joystick NXT ''functions'', check out the [[NXT_Functions_Joystick_C...") |
|||
| 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!'' | ||
| − | |||
| − | |||
| − | |||
|- | |- | ||
|} | |} | ||
| + | {{tl|1|}} | ||
| − | + | 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. | |
| − | + | ||
Revision as of 11:11, 28 August 2012
| For ROBOTC Joystick NXT functions, check out the 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.
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
After your program has been downloaded and the debugger is opened, you can open the Controller Station by:
|
| File:JoystickControl Simple.png |
| Once the Controller Station is opened, ROBOTC will look for any joysticks attached to your computer via USB. You can choose which joystick you want to robot to be controlled with by changed the joystick under the available drop-down menu. If you have no joysticks available, this list will be empty and ROBOTC will alert you that you have "No Controllers Configured" |
|
| You can see what data is being generated by the Joystick Station by looking at the X1, Y1, POV, X2, Y2 and Buttons display directly below the dropdown menu. This will give you realtime feedback of what values are being sent to your NXT from the Joystick Station. This data will also be illustrated with green dots to reflect the values and button presses.
|
|
Joystick Control - Game
| There is also a second Joystick Control window, "Joystick Control - Game". This window is specifically designed to emulate the FIRST Tech Challenge game mode. To test your FTC competition programs, you can use the controller station to mimic what the Field Management System will do. This includes switching between Autonomous and User Control, Changing if your robot is on the blue or red alliance and also disabling (or pausing) your robot. These commands can be found on the left side of the Joystick Station.
|
| File:Single expert menu.gif |
After setting the Menu Level to "Expert", you can then access the "Joystick Control - Game" station by:
|
|
| As you can see, the window has a few more options than the "Joystick Control - Simple" screen did. |
|
| If you would like to use two controllers, click the "Dual Joysticks" button to expand the Joystick Control window to facilitate two controllers. You can assign the same controller to both Primary and Secondary Joysticks, but this is not recommended. |
|






