Hello, I currently am trying to work with several SRF08 sensors (on an Arduino Uno), but in order to do so, I obviously have to change their addresses... but, although I follow the data-sheet's instructions, I can't get to do that. Here is the code :

``````  Wire.begin();
Wire.send(0);
Wire.send(0xA0);
Wire.endTransmission();

Wire.send(0);
Wire.send(0xAA);
Wire.endTransmission();

Wire.send(0);
Wire.send(0xA5);
Wire.endTransmission();

Wire.send(0);
Wire.endTransmission();
``````

I don't know what to do, I hope someone will be able to help. Thanks in advance.

it doesnt accept all addresses according to this: http://www.robot-electronics.co.uk/htm/srf08tech.shtml

For some reason it kinda worked. I tried to set an address to EE, and it was set to F7 instead... any idea why it occurred ? Though strictly speaking it doesn't matter to me as long as the address has changed, I'd like to know how this works. Maybe a bit is shifted.

oh - 0xF7 isnt a correct SRF08 address...

i guess, that is because of 7bit I2C addresses: 0xF7 = B11110111 0xEE = B11101110 0xEE (8bit address) --right-shift--> B01110111 = 0x77

so i guess ur new 7bit I2C address is 0x77 (which is equal 0xF7 modulo 128)... :)

Hm, addresses are supposed to range from E0 to FE though. And I know odd addresses aren't suppose to work, but they do. Thanks for the help.

the arduino Wire library uses 7bit I2C addresses... http://arduino.cc/it/Reference/Wire

u can convert them like this: 1. 7bit to 8bit: shift left by 1bit 2. 8bit to 7bit: shift right by 1bit

8bit range: E0..FE (just even numbers) --> 7bit range: 70..7F (all numbers)