View Single Post
  #1   Spotlight this post!  
Unread 08-01-2009, 01:13
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 325
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Basic functions in windriver

Have you looked at the example template things that they have in windriver? They show a couple of decent examples.

I haven't been able to actual put code on our controller yet, but I have been playing with the code a bit (I don't know if what I wrote works yet ) so I can't help too much yet

From what I have looked at it looks like there are a couple of ways to go about the basic drive functions. You need to create your joystick objects

Code:
Joystick LeftStick(1);
Joystick RightStick(2);
then either create a RobotDrive object or create motor controller objects (or both)

Code:
Jaguar LeftMotor(1);
Jaguar RightMotor(2);

then set the speed to the joystick

Code:
LeftMotor.Set( LeftStick.GetY() );
RightMotor.Set( RightStick.GetY() );
The only problem is that I am not sure if Joystick::GetY() returns a scaled number between -1.0 and 1.0 that I think the Jaguar.Set() takes, otherwise there is the RobotDrive function which is shown in the simple robot sample example template thing

Hope that helps
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -