View Single Post
  #2   Spotlight this post!  
Unread 22-01-2006, 08:44
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Direct Control of PWMs and OI in WPILib

This should help you out.

X = GetOIAInput(A,B);

X is the variable name you want assign you items too.
A is the OI port 1 through 4
B is the Axis on the joystick
1 = X-Axis
2 = Y-Axis
3 = Wheel
4 = Aux Port

Then to drive the motor.

SetPWM (C,D);
C is the PWM port number 1 - 12
D is the Value or Variable to be used to drive the motor.

Example of them working together to make a tank drive setup.

Joy1 = GetOIAInput(1,1);
Joy2 = GetOIAInput(2,1);

SetPWM (1,Joy1);
SetPWM (2,Joy2);