OCCRA
Go to Post I love the dedication of Robotics kids. :) - Danielle H [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-21-2011, 10:14 AM
Johnson Huang Johnson Huang is offline
Registered User
FRC #0865
 
Join Date: Sep 2011
Location: Canada
Posts: 2
Johnson Huang is an unknown quantity at this point
HOw to create a program in labview for ps3 controller

I'm new to FRC robot and i need a basic program for ps3 controller in labview. I need an example on how to start.

Last edited by Johnson Huang : 09-21-2011 at 10:18 AM.
Reply With Quote
  #2   Spotlight this post!  
Unread 09-22-2011, 12:16 AM
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: HOw to create a program in labview for ps3 controller

Long Answer:

Before you test anything relating to FRC, you have to make sure your C-RIO and things are set up. If you don't have that already done, some great resources are in usfirst.org/frc/kitofparts If you just want to figure out how to manage the ps3 controller, then all you really need is the C-RIO (properly imaged, etc), a programming laptop, and the Driver Station (classmate 2go PC). Of course, in order to get the C-RIO running, you'll need power as well.

Now, actually reading the values of the PS3 controller is pretty simple. Go to robot main, then into periodic tasks. Make a while loop in there, with a false constant on the "stop" block. Also, add a wait (ms) block in it (under Porgramming -> Timing) with a wait of 100 ms. Then, in the functions palette, go to WPI Robotics Library, DriverStation, Joystick, then grab a Joystick Get function. Move your mouse over the top left corner (over JoystickDevRef) until you get the "thread"/"wire" mouse, right click, and select create -> constant. Do the same with the Axes and Buttons wires, except create an indicator.

Now go to robot main and run the program. Once it's done downloading, open up the front panel of periodic tasks and you should see all the buttons and axes there. Plug in your PS3 controller and try moving the joysticks around and pressing the buttons. The values on the front panel should change with the joysticks. Note that the buttons might be listed as axes as well, since I have heard that they're analog (they have force gauges in them).

Once you've tried it out and such, it may be a better programming practice to use the joystick Open, registry set, and registry get, but I haven't found a use for them in this case (they're very important for motors and such though!)

Short Answer:
They act like joysticks, so use those vis.
Reply With Quote
  #3   Spotlight this post!  
Unread 09-22-2011, 08:07 AM
Johnson Huang Johnson Huang is offline
Registered User
FRC #0865
 
Join Date: Sep 2011
Location: Canada
Posts: 2
Johnson Huang is an unknown quantity at this point
Re: HOw to create a program in labview for ps3 controller

Alright, thanks for the informations. I'll test it now. Thanks.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 06:20 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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