PING)) Sensors.. Communication Help

PeterH:

husein06:
The main goal is, I'm trying to figure out what's the distance(or time) difference of the 2 receivers that are located on the robot, so I can adjust the motors and drive.

So the sender itself is not being controlled by the robot, you're only trying to detect the timing difference between the pings being received by two receivers?

Perhaps just knowing which receiver was triggered first would be enough and you may not need to know the precise timing difference between the two receivers. In that case I guess your best bet would be to try to get the receivers to trigger a pin change interrupt, and in each ISR register which receiver was triggered and what time it was triggered at. The time value would enable you to ignore subsequent signals from the 'other' receiver which would presumably be caused by the same incoming ping. I don't know how reliable this would be and you may need to be smarter about how you treat the inputs from the two receivers (for example you might require both receivers to have detected the signal before you pay any attention to which one was first) but that would take more effort - I'd try the simplest approaches first.

I have 3 ping)) sensors... I detached the transmitter from 2, making them receivers. And detached the receiver from one making it a transmitter. So I have 2 receivers on the robot and I'm holding a transmitter I signal a ping to the transmitter and the receivers "think" they also sent out a ping, but in reality it's the transmitters. Then both receivers will wait for the echo, Im trying to configure it so both receivers receive something, that way I can calculate in what direction the transmitter is in.

For example: Ping request sent
receiver 1 10 inches
receiver 2 15 inches
now I know the transmitter is to the right and i can adjust the motors.

But the problem I'm facing is with my code shown earlier in the first post, I'm only getting one reading of receiver 1 and nothing for receiver 2 (and I think its because receiver 1 is getting called up first, because when I interchange and make receiver 2 read first it works and receiver 1 doesnt)