|
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);
|