have you tried doing this?
Code:
if (p1_sw_top ==1)
{
pwm01=200;
}
pwm01=200;
what i mean is, RIGHT after the button code, you make it go foward anyway.
this way, if there's anything that would change pwm01's values, you will know, because the robot will still not move. if it
does move, well then move on to another solution.