Matt White
07-17-2006, 10:36 AM
I'm using an ADC0834 to process analogˇreadings from 4 Sharp GP2D12 sensors.ˇ All that works fine.ˇ I have an array called adc(0,1,2, ...).ˇ Essentially what I want to do is evaluate the four sensor readings stored in the array and find out which one has the largest value.ˇ While this seems like an easy task when I start coding it, the excersize turns into a lots and lots of IF, THEN, ELSE statements... Anyone got a better way to do this?ˇ
Would I be better off just checking each value against a set of threasholds?ˇ The application is colision avoidance -- I'd also like to know "how far" I am from an object, wall, etc.ˇ The idea being the closer I am to an obstacle the more of a course correction I need to make.
Thanks!
Matt
ˇ
Would I be better off just checking each value against a set of threasholds?ˇ The application is colision avoidance -- I'd also like to know "how far" I am from an object, wall, etc.ˇ The idea being the closer I am to an obstacle the more of a course correction I need to make.
Thanks!
Matt
ˇ