View Single Post
  #10   Spotlight this post!  
Unread 27-01-2014, 18:45
Invictus3593's Avatar
Invictus3593 Invictus3593 is offline
time you like wasting is not wasted
FRC #3593 (Team Invictus)
Team Role: Leadership
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Tulsa, OK
Posts: 318
Invictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really nice
Re: Xbox One controller feedback?

Quote:
LabVIEW can invoke any DLL function or ActiveX control that you want. Look in the Connectivity function palette
I've been trying to do just that. This is the C# code I was able to successfully get the controller to vibrate:
Code:
PlayerIndex controller = new PlayerIndex();

if (checkBox1.Checked == true)
{
    GamePad.SetVibration(controller, 1, 1);
}
else
{
    GamePad.SetVibration(controller, 0, 0);
}
But, as you can see, the SetVibration method requires three parameters: (PlayerIndex playerIndex, float left, float right)

I can use the .net construct node to get the Microsoft.Xna.Framework.PlayerIndex controller with this code:

but I don't know how to invoke the method SetVibration, since it is only a method in Microsoft.Xna.Framework.Input.Gamepad which has no constructors.


Quote:
so its my third year programming and ive never done xbox 360 controllers the most complicated thing that ive ever done was a six cim drive train so i wanted to know if someone could tutorial me on programing a xbox 360 controller using the left thumbstick for movement forwards and backwards and the right thumstick for movement right and left and the right trigger for acceleration forward and the left trigger for backward acceleration
i know itll be difficult but i wanted a challenge and now im second guessing myself
and need tons of help !!!!
Do a quick search here on CD for "Xbox layout". You'll find some good resources on which digital axis corresponds to the physical joystick. From there, you can figure out which axis is needed for which function.
__________________
Per Audacia Ad Astra
Reply With Quote