Is anything being displayed by your printf? You didn't mention anything about that.
This is exactly how we dump out joystick and pwm values. Saturday it showed us that one of our joysticks from last year had died. The only difference in our code syntax is this:
Code:
printf("Joystick1 X = %u\r\n", (int)p1_x);
printf("Joystick1 Y = %u\r\n", (int)p1_y);
The small twitch at startup comes from servo values being initialized, most to 127.
Also verify your joystick is plugged in to port 3 and your servo to pwm09.
By the way, the original version of the code has