|
Re: Value of degree to calculate range?
So you should have
EXACTLY as many array values as the number of different PWM values your camera would possibly output.
I would put some bound checking too... because you will crash the program if you give it a bad index value!
You said that your tilt center is 144, and that tilt_max is 194. I'm assuming the robot won't get tall enough tilt the camera down past the center. Is this correct?
Thus your array should contain 51
entries. 194-144 + 1 =51 ... add 1 since the set is inclusive on both sides
So we want a value of 144 to point to array[0] and 194 to point to array[50] so all you need to do is subtract 144 from the PWM value
I'm not sure how you got 67 entries? can you explain.
__________________
Team 701
Last edited by Salik Syed : 13-02-2007 at 19:00.
|