-
Notifications
You must be signed in to change notification settings - Fork 0
legacy setup
In the zip file, Game Controller revised (combined).pdf
shows how the controls are supposed to be aligned, once you work out which axes/rots for the sticks & which buttons map where.
Run Joystick\Joystick.exe
, it shows a screen which updates live as you move the sticks and hit buttons:
- Press "Create Device" after connecting a joystick
- Move left stick up/down, note which X,Y,Z and whether Axis or Rot; do the same for right stick up/down
- Move the d-pad around, note what changes
- Push each button in the PDF, note which DirectX button address relates
- Add changes to
joystickProfiles.xml
under a new profile (see below)
If the joystick has analog toggling, it needs to be in analog mode.
If you can figure out the joystick axis & button IDs for tank drive left/right stick up/down, and the various buttons to control the robot, add a new XML block for each new kind of joystick to joystickProfiles.xml
.
<JoystickConfig>
<Name>PutNameHere</Name>
<Sticks>
<L_Motor>YA</L_Motor>
<R_Motor>ZR</R_Motor>
<FineMotor>P0</FineMotor>
</Sticks>
<Buttons>
<A_MotorInc>04</A_MotorInc>
<A_MotorDec>05</A_MotorDec>
<D_MotorInc>06</D_MotorInc>
<D_MotorDec>07</D_MotorDec>
<ReverseToggle>09</ReverseToggle>
<PowerSelect>00</PowerSelect>
<GearSelect>02</GearSelect>
<PowerReset>03</PowerReset>
</Buttons>
</JoystickConfig>
- The sticks tend to have 'axis' and 'rotation' for X, Y, and Z
- The D-pad (for fine motor control) is a weird degrees-direction thing
- The buttons go from 00 to 13 or something
Left & Right stick control motors B & C (or vice versa). You can also use the "Flip Motors" option to reverse direction.
A & D motors are run forward or backward with the trigger buttons (or equivalent on your joystick); i.e. the "action" motors
Everything runs at 100% power by default. Sometimes this is too fast for a given drive train and/or a given "action" attachment. In which case, various buttons (the ones labelled "1" and "3" in the PDF) can cycle through speed settings to slow things down (eventually looping back around to 100%). Button "2" resets the power for drive and actions to 100%.
"Fine drive" via the D-pad is 10% speed to the motors, highly useful for when the driver is trying to carefully align the robot to a thing (picking up a thing, scoring a thing, going through a narrow opening, etc.).