Ping as a receiver
I've been using the Ping sensor recently and have gotten good results. I was wondering if anyone knows what it will do if you hit it with a ping that comes from another module? We will be using these with some robots for a class project and I thought there could be some rudimentary communication from one bot to the other. Maybe one bot could test for distance and when another bot·received the ping and it was not their own it would know another bot was in the area. I'm guessing that the receiver is only activated after the ping command has been sent but maybe not. Has anybody investigated this idea?
·
·
Comments
The reason for randomizing the ping interval is so you won't inadvertently be synchronized to another bot that's using the same technique. With randomizing, each bot is more likely to find a time slot when the other isn't pinging. Just be sure that each interval of silence, or "holdoff time" is several times the longest expected echo delay.
This "random holdoff" technique is often used in networking for dealing with collisions, when two network hosts try to transmit at the same time. Upon detecting a collision, each waits for a random length of time, then retries if the other hasn't already begun transmitting.
-Phil