Please use 255, not 254.
If you use 254, and your joystick goes to max in one direction (255), you would get -1. Since the joystick input is an unsigned char, the value will "wrap around", making it 255 again.
If you were trying to go left, it would suddenly go full power to the right.
So:
Code:
inverted = 255 - normal;