NXT Using Joysticks
(→Joystick Control - Simple) |
|||
| Line 93: | Line 93: | ||
*Click on the "Joystick Control - Simple" menu option to open the Controller Station | *Click on the "Joystick Control - Simple" menu option to open the Controller Station | ||
|- | |- | ||
| − | |[[File: | + | |[[File:Screenshot-2012-09-11 17.00.58.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" | |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" | ||
Revision as of 14:10, 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 - 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. |
|







