Quote:
|
Originally Posted by AsimC
When you say current power...where am i getting this number from?
|
That's your normal pwm output value.
This is a more concrete example using a joystick value to drive:
Code:
int temp; // use to hold signed pwm value (-127 to 127) for simpler math
pwm13 = p1_y; // (or whatever your normal power calculation is)
temp = pwm13 - 127; // convert to human math:)
temp = temp - (temp/127 * 10);
pwm13 = temp + 127; // convert back to normal 0-254 range