Ok, here is a question for the Arduino literate.
Has anyone tried using multiple ultrasonic rangefinders slaved together?
Like the ubiquitous HC-SR04 sensor.
(Arduino
Ultrasonic Module HC-SR04 Distance Sensor Measuring Transducer | eBay )
I.E. one unit (call it center) is actively pinging the remaining units (call them left and right) are listening.
If the delay is the same between left and right, then you are heading at an object, delay is less if object is closer to one side.
Goal is faster collision avoidance.
This will probably only work with a direct port read so we would be working in bytes and looking for the time a byte changes. (hence it should be interrupt driven)
Correct me if I’m wrong, but I’m thinking call the interrupt when a byte changes (could be from left, right, or center)
Record byte value and timer count (probably in an array)
Process the distances outside the interrupt
Make changes to speed and direction as needed,
Ping again
The Due seems like the natural choice for this kind of operation, but the Mega might also work.
I did a cursory search here and on Google but haven't seen anything similar.
Anyone ever try this?
Interrupts and I have an uneasy truce, what pitfalls should I expect?
A