In general, a good way to alter an output by a constant factor is:
Code:
pwm01 = (pwm01-127)*0.5+127
This will give you half the magnitude of your original output... change the 0.5 to taste. (Also, be careful, and pretend that this is pseudo-code. Because PWM values are stored as unsigned chars, you may get some interested errors with casting when you go in reverse. Maybe cast pwm01 as an int first?)