The joystick buttons should follow this sort of naming convention:
Code:
p1_sw_aux1
p1_sw_aux2
p1_sw_trig
p1_sw_top
Then just change the number of the port. You may want to look at ifi_frc.h. Everything's in there.
You should be able to work these with a simple if statement, something like:
Code:
if (p1_sw_aux1){
pwm01=255;
} else {
pwm01=127;
}