Reversing the joystick axis

Sorry if I didn’t search well enough, but how does one go about reversing the joystick value? I tried a negative, but I realized the pwm value is an unsigned val, what is the math I need to do on the joystick value to make it so foreward is backward and backward is foreward?

#DEFINE PWM_MAX 254
...
pwm01 = PWM_MAX - p1_y //Your joystick 1 y-value is reversed

Instead of:

pwm01=p1_x;

do:

pwm01=255-p1_x;

Good luck.

Yeah, this worked for us