There is a function in user_routines.c called Default_Routine(). This is basically your playground, this function runs about 38 times a second (26.2 milliseconds) and you put all your logic in here. Your OI data (joystick values, buttons pushed) is all available in aptly named variables (p1_y, p2_x, p2_sw_trig, etc) that you can check with if statements. For example to make the trigger on the joystick connected to Port 1 drive the robot forward and your motors are on pwm01 and pwm02 you might try this:
Code:
// in Default_Routine()
...
if(p1_sw_trig) // If the trigger is pushed
{
pwm01 = 255; // Left motor full speed forward
pwm02 = 0; // Right motor full reverse since it's likely facing the opposite direction
}
else // Trigger is not pushed
{
pwm01 = 127; // Motor stopped;
pwm02 = 127; // Motor stopped;
}
Note this is not a recommend way to drive, you're better off mapping the pwm outputs to the joystick inputs like this:
That should be enough for you to get started, it's all just basic logic.
Good luck!