View Single Post
  #14   Spotlight this post!  
Unread 12-02-2007, 21:41
Ianuser Ianuser is offline
Registered User
FRC #0570
 
Join Date: Feb 2007
Location: new york
Posts: 64
Ianuser is an unknown quantity at this point
Re: Value of degree to calculate range?

I actually just realized that I have to change the numbers in the array because I have to recalculate the height of my camera, so the numbers will be a little different. Lets say I'm working with this, though. What I'm worried about is this:
Code:
unsigned int Find_Distance(void)
{
	return(targetRange[pwm07-67]);
}
Is it right to subtract 67 from the pwm value? What should I be doing in order to translate the one index number out of 127 pwm indexes, or 90 degrees, into the range that I should have? Thanks