can you look at this and tell me if you see any errors.
Code:
//the encoder is at 50 resolution
//the arm motor is attatched to pwm_02
//the encoder is attatched to rc_dig_in06
unsigned int encoder;
if (p2_sw_trig == 1)
pwm_02 = 220;
if (rc_dig_in06 == 1)
encoder = encoder + 1;
if (encoder == 11)
pwm_02 = 128;