Log in

View Full Version : gamepad programming


bf2416
28-01-2013, 08:57
Hey, CD,

My team is thinking about using a gamepad style controller (aka xbox style). I need to know if the 'joystick vi' family will work with a game controller.

Thanks for the input.:D

pasco27
28-01-2013, 09:15
It should work just fine if it's USB compatible. I dont know if wireless will work though.

Hope this helps

MagiChau
28-01-2013, 09:32
As long as the gamepad is an HID (Human Interface Device) the joystick.vi should be compatible. Most gamepads should be a HID.

bf2416
28-01-2013, 10:45
Alright, thanks guys. I figured they would work, but was needed confirmation before I request I controller for 'el jefe'. Again thanks for the feedback.

Now for another question: to control a tank drive like a video game, with a button for drive and joystick for steering, how would I control the steering? I think it would be something like the following:

if x<0, 1-lxl= left drive
if x>0, 1-lxl= right drive


I know that some mobility will be compromised, but we have considered this. I am still trying to figure out the best way to control this thing lol. Thanks again for the input:D


Edit: also, any suggestions for improving this would be greatly appreciated

stingray27
28-01-2013, 10:59
Alright, thanks guys. I figured they would work, but was needed confirmation before I request I controller for 'el jefe'. Again thanks for the feedback.

Now for another question: to control a tank drive like a video game, with a button for drive and joystick for steering, how would I control the steering? I think it would be something like the following:

if x<0, 1-lxl= left drive
if x>0, 1-lxl= right drive


I know that some mobility will be compromised, but we have considered this. I am still trying to figure out the best way to control this thing lol. Thanks again for the input:D


Edit: also, any suggestions for improving this would be greatly appreciated

I don't quite follow what variable x is...

bf2416
28-01-2013, 11:02
I don't quite follow what variable x is...

X is the x-value of a joystick, between -1 and 1

stingray27
28-01-2013, 11:06
X is the x-value of a joystick, between -1 and 1

Oh sorry. Now I understand that. Sorry about that. I was stuck upon the fact that typically tank drive utilizes 2 axis for movement and arcade drive uses 1 axis.

bf2416
28-01-2013, 11:17
A button would set the motors to one, then the joystick would reduce the power to a side, causing smooth turning rather than zero turn.