Reading Multiple SRF04 Sonar Modules

Hi guys,

can you tell me how I can read simultaneously from multiple sensors SRF04?
I implement the project quadrotor, where I have 4 ultrasounds at 90 degrees. They measure the distance to obstacles. I need to know every 50ms distance to obstacles in each direction (ie from all four sensors). Can someone write at least pseudocode ?
Thanks

Martin

I'd assume an update rate of no more than 20Hz for all four sensors, so only 5Hz for any one sensor.

I'd also think long and hard about relying on ultrasound in an environment dominated by rapidly moving air.

Don't try to read and act on each sensor.

Read all sensors to one pin input.

If your "object" is moving forward only the front sensors will close up to an obstacle and create an alarm, just reverse, if a rear sensors sees trouble then go forward.

The same thing will apply to side sensors.

When you apply the "reverse movement" put a shift of direction into the motor code, this will get it out of a "boxed in " situation.