Code:
Left Joystick: Right Joystick:
[drive fwd] [arm up]
^ ^
| |
[drive left]<------->[drive right] [claw open]<------->[claw close]
| |
v v
[drive rev] [arm down]
Using the joystick as mapped above, try using this code:
Code:
#include "Main.h"
void main ( void )
{
unsigned char arm; // Create a unsigned char variable called arm
while ( 1 )
{
// The Arcade Drive Code Block
// Connect The Left Drive Motor to Port 1
// Connect The Right Drive Motor to Port 2
Arcade2 ( 1 , 3 , 4 , 1 , 2 , 0 , 0 ) ;
// The Arm Drive Code
// Connect the Arm Motors to Ports 3 and 4
arm = GetRxInput ( 1 , 2 ) ;
SetPWM ( 3 , arm ) ;
SetPWM ( 4 , arm ) ;
// The Claw / Grabber Code
// Connect the Claw Motor to Port 5
MotorRcControl ( 1 , 1 , 5 , 0 ) ;
}
}