View Single Post
  #15   Spotlight this post!  
Unread 13-02-2007, 18:57
Salik Syed Salik Syed is offline
Registered User
FRC #0701 (RoboVikes)
Team Role: Alumni
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Stanford CA.
Posts: 514
Salik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud of
Send a message via AIM to Salik Syed
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.