Connect the common of the switch to ground on the OI, the "up" contact to
p4_sw_aux1, and the "down" contact to
p4_sw_aux2. Assuming the arm motor is on pwm3, your code would look like this:
Code:
if (p4_sw_aux1 == 1)
pwm3 = 254;
else if (p4_sw_aux2 == 1)
pwm3 = 0;
else
pwm3 = 127;