Difference between revisions of "NXT Using Joysticks"
(→Joystick Control - Competition) |
|||
Line 1: | Line 1: | ||
− | <yambe:breadcrumb self="Using Joysticks"> | + | <yambe:breadcrumb self="Using Joysticks">TETRIX|TETRIX</yambe:breadcrumb> |
Latest revision as of 21: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