I am working on coding my IR sensors for distance readings and eventually mapping.
I have one servo with 4 IR sensors aiming Front,Back,Left,right mounted on it.
I plan on sweeping the servo from 0deg, to 90deg, and taking a measurement from each IR every 5 deg. This shoud cover a 360deg area with the IR's.
I've read the tutorial on this and search the forum, but does anyone have a code example of how this is accomplished?
on my microcontroller it streams the IR data from the time I enable them, so I don't need to send any commands to turn them on and off to take an individual reading.
I suppose I just need to query my servo position, so when it is @ a 0 angle, record the sensor stream data, when it's at a 5deg angle, record sensor stream data... etc..
and then just put these values into arrays for each sensor...
A code example would be great though, just so I could see how someone else does this.
Thanks!