Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: John Lee on February 29, 2012, 08:41:16 AM
-
Im trying to get readings from two different sonar sensors (SRF02) mounted on an iRobot Create.
However I keep getting results of both sensors as 1 (basically there is a clash in readings). I used srf02.h to change the address of one sonar, but I end up moving both sonars to the new address. I cant separate them !
Is there something im missing ? If you want more information please let me know and I will update this ASAP.
-
Sounds like you have both sonars connected when you change the address. In order to change it, you can only have one sonar connected to the device at a time. Just hook up one sonar, change the address, and repeat with the other(or leave it to the default).
-
And looking ahead: make sure that you don't try to read both sonars at the same time. Since they send pulses of sound then one sonar can receive an echo from the other. So you need to do them one after another - allowing a pause in between. How big a pause? Google for the speed of sound - and allow enough time for one sonar 'ping' to die away before activating the next one.