Quote:
Originally Posted by usbcd36
...Simplest way to do that is subtract the value you assign to the PWM outputs from 254:
|
Actually you should subtract from 255 in this case. (if Limit_Mix returns you a 255, then pwm13=254-255=-1, but the -1 wraps over the unsigned char to 255, whereas if you subtract from 255, then you will correctly get 0) So, that line should read
Code:
pwm13 = pwm14 = 255 - Limit_Mix(2000 + p1_y + p1_x - 127);