![]() |
Gamepad help
Hello
Im semi new to using wind-river though i do a bit of visual studio work so I understand the terminology. My current project is programming a gamepad to work im pretty sure it is a logitech f310 but i can adapt code to work for which ever one i have. So can anyone give me some example code so i can see what i need to work on. |
Re: Gamepad help
First you have to declare them in the main class
Code:
class BuiltinDefaultCode : public IterativeRobotCode:
BuiltinDefaultCode(void)WPILib Joystick Doxygen http://www.virtualroadside.com/WPILi..._joystick.html Code:
void TeleopDrive(void)Code:
//Define Buttons-Buttons 1-8 are used. They are not labeled, you can try reading all 8 and seeing what maps to what. I know that 9-12 are not used. Axis 1 -> Left X Axis 2 -> Left Y Axis 3 -> Sum of L2 and R2 analog triggers - One is positive, the other is negative, both or neither is 0. Axis 4 -> Right X Axis 5 -> Right y Axis 6 -> D-Pad X (binary like above - Note that you can't read D-Pad Y) |
Re: Gamepad help
If you do have the F310, I wrote a class a while back to make using it easier. You can find it here:
http://www.chiefdelphi.com/forums/sh...ad.php?t=90022 If you'd like to write your own code, you can at least use it for the axis and button mappings. If not, usage is very similar to a regular WPILib Joystick. Code:
F310 *gamepad = new F310(1); |
| All times are GMT -5. The time now is 17:38. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi