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