I am attempting to modify the response of an RC sevo to give a non-linear response (e.g a square law relationship between the PWM from the receiver and the PWM to the servo).
I am having some difficulty within the confines of integer maths and word variable length. I understand that the actual calculations within a single line of code uses a double word, so would the following work:
W1=W0*W0*80/10000
Where W0=380-300*100/80 (=100)
And the result for W1 should be 80
Thanks in advance for any help.
Kevin
Â
I am having some difficulty within the confines of integer maths and word variable length. I understand that the actual calculations within a single line of code uses a double word, so would the following work:
W1=W0*W0*80/10000
Where W0=380-300*100/80 (=100)
And the result for W1 should be 80
Thanks in advance for any help.
Kevin
Â