Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   gamepad programming (http://www.chiefdelphi.com/forums/showthread.php?t=112229)

bf2416 28-01-2013 08:57

gamepad programming
 
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

Re: gamepad programming
 
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

Re: gamepad programming
 
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

Re: gamepad programming
 
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

Re: gamepad programming
 
Quote:

Originally Posted by bf2416 (Post 1223246)
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

Re: gamepad programming
 
Quote:

Originally Posted by stingray27 (Post 1223250)
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

Re: gamepad programming
 
Quote:

Originally Posted by bf2416 (Post 1223251)
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

Re: gamepad programming
 
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.


All times are GMT -5. The time now is 02:08.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi