View Single Post
  #15   Spotlight this post!  
Unread 08-02-2009, 14:17
kyungjin kyungjin is offline
Software Specialist
AKA: Daniel
VRC #0646
Team Role: Programmer
 
Join Date: Aug 2008
Rookie Year: 2009
Location: Honolulu, Hawaii
Posts: 65
kyungjin is an unknown quantity at this point
Send a message via AIM to kyungjin Send a message via MSN to kyungjin
Re: Running the Motors Backward in WindRiver & cRIO Freezes

I did in fact stumble upon finding how to run the motors in reverse.

For sake of discussion let's assume that we are trying to make a Jaguar motor called wheel in port 3 go half speed backwards...

For some reason, if we code it like this, the motors only accepted forward values, thus doing nothing when going backwards:

Code:
Jaguar Wheel = new Jaguar(3);

Wheel->Set(-0.5);
I was experimenting with the code in the WPI library and found that the correct way to set motor speeds or use any other functions for that matter was:

<Object Name>.<Function Name>(<Parameters>);

Therefore, the above example would be coded something like this:

Code:
Jaguar Wheel = new Jaguar(3);

Wheel.Set(-0.5);
... where Wheel is your object name... Set is your function name... and -0.5 is your parameters (as specified in the WPI library function for setting motor speeds).

I hope this solved the problem for you. If not, it could be a hardware issue (maybe check to see if your Jaguar or Victor has jumpers that allow forward/backward movement).

- Daniel
Reply With Quote