Quote:
|
Originally Posted by ForgottenSalad
Small question, as I've forgotten how to scale the PWM output for a half speed switch, quarter speed, etc. How would I have to modify the input assigned to the pwm for adjusting the speed?
By that I mean what I would have to add to the pwm01 = p1_y;
Thanks,
-Mike
|
Try this:
pwm01 = ((int)p1_y - 127)/2 + 127
P.S.
I threw in the (int) because I don't remember if p1_y is defined as a signed or unsigned char. If it's unsigned, it wouldn't work without.