View Single Post
  #11   Spotlight this post!  
Unread 12-28-2008, 11:59 PM
koreabell koreabell is offline
Team 956 Safety Captain
FRC #0956 (Eagles)
Team Role: Programmer
 
Join Date: Sep 2008
Rookie Year: 2007
Location: Oregon
Posts: 24
koreabell is an unknown quantity at this point
Re: Getting Familiar with Programming in WindRiver

When you're initializing joystick, you have to put which port the joystick is plugged in to as parameter

on the sample code you'll see this
Code:
stick = new Joystick(1); // create the joysticks
that "Joystick(1)" (which is constructor) means that it'll have control over Joystick that is plugged into port 1 on Driver Station

if for some reason it doesn't work, then it can be joystick driver software problem, which can be solved by copying driver file to USB Memory Stick(Mass Storage Device) and then plugging into driverstation.
I do not know the procedure of installing driver software since we didn't get new controller yet, but I heard that it can be done on both on-line and off-line workshops

also as I searched through some beta testing teams' codes, I found out that they were using Header & Source file for the joystick so I think it can be done via programming manually instead of installing device drivers. (I didn't analyze that files so i might be wrong but it looked like those files are in charge of joysticks teams are using)

and to obtain values from joystick, if you read Joystick class under C programming reference, there are a lot of functions like GetX, GetY, GetZ, etc

you can use that to get values of joystick axis, buttons, and stuff like that
Reply With Quote