0
$\begingroup$

Rosanswers logo

I've got a single SRF08 ranger running on the supplied 0xF8 address, but I can't get it to work on the other addresses (I need several sensors). I have verified the ranger to be addressed to 0xE8, but the ranger does not reply to either the programmed address 0xE8, or the +4 address the author uses for subsequent calls.

The author suggests:

New_Address += 4; // offset address not sure why this is but it works for this address

http://www.ros.org/wiki/rosserial_arduino/Tutorials/SRF08%20Ultrasonic%20Range%20Finder

I have implemented a multi-ranger program in the past (on a 2620 PIC), and I didn't need to do any "+4" trick to get it working. It also worked on all six addresses. I have not yet "ported" my my code to the Atmel (I wanted to use the Sonar_srf08 library).

There is a newer version of the library, but it's essentially the same, just added gain and range parameters to several wire.writes.

http://playground.arduino.cc/Main/SonarSrf08

Any ideas or fixes?

Thanks, Alan


Originally posted by KM6VV on ROS Answers with karma: 191 on 2013-03-29

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I fixed the problem. The SonarSRF08 library did not shift the I2C address right by one, so the addresses sent to Wire were wrong.

Wire.beginTransmission(address/2); Wire.requestFrom(address/2, numBytes);

Now the +4 added to the address in the example (calling program) is not needed. I have now added code to cycle through my three SRF08 Sonar modules.

Alan


Originally posted by KM6VV with karma: 191 on 2013-03-30

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.