Reading registers from I2C device (Si 570)

I am trying to read 6 registers using Wire.h from a I2C device, Si 570.
Registers are, 7,8,9,10,11,12.
The I2C device address is 55 Decimal.
All that I get on the serial monitor is; FF FF FF FF FF FF.

#include <Wire.h>
#include <SoftwareSerial.h>
//---------------// Si 570 Register Reader, L Snook, 9-29-15--------------------------------------------------
byte reg_7=0;
byte reg_8=0;
byte reg_9=0;
byte reg_10=0;
byte reg_11=0;
byte reg_12=0;

int addr=55;

void setup()
{
Serial.begin(9600);
Wire.begin(addr);
}

void loop()
{

Wire.beginTransmission(addr); // transmit to device #55 (0x2c)
Wire.write(7); // This first byte written here ‘r’ moves the register pointer to the register with address ‘r’
Wire.endTransmission();

Serial.println(“Print six control bytes in hex, 7 to 12:”);
delay(500);
reg_7=Wire.read();
Serial.println(reg_7, HEX);
reg_8=Wire.read();
Serial.println(reg_8, HEX);
reg_9=Wire.read();
Serial.println(reg_9, HEX);
reg_10=Wire.read();
Serial.println(reg_10, HEX);
reg_11=Wire.read();
Serial.println(reg_11, HEX);
reg_12=Wire.read();
Serial.println(reg_12, HEX);
Wire.endTransmission(); // stop transmitting
}

  Wire.begin(addr);

If you set your Arduino to the same I2C address as the target device there will be a conflict on the I2C bus. Usually if the Arduino is going to be the bus master you don't assign it an address:

  Wire.begin();

Thanks John,
Well, I changed Wire.begin(addr); to Wire.begin();
No improvement.

Load a sketch that does an I2C bus scan. You may have the wrong address.

Ran a I2C scanner; address is 55 hex.

Here is what I have so far; Still report “FF” for all registers.

#include <Wire.h>
#include <SoftwareSerial.h>
//---------------// Si 570 Register Reader, L Snook, 9-29-15--------------------------------------------------
byte reg_7=0;
byte reg_8=0;
byte reg_9=0;
byte reg_10=0;
byte reg_11=0;
byte reg_12=0;
byte addr=(0x55);

void setup()
{
Serial.begin(9600);
Wire.begin();
}

void loop()
{
Wire.beginTransmission(addr); // transmit to device #55 (0x2c)
Wire.write(7); //Moves the register pointer to the register with address ‘7’
Wire.endTransmission();
delay(500);
Serial.println("");

reg_7=Wire.read();
Serial.println(reg_7, HEX);
reg_8=Wire.read();
Serial.println(reg_8, HEX);
reg_9=Wire.read();
Serial.println(reg_9, HEX);
reg_10=Wire.read();
Serial.println(reg_10, HEX);
reg_11=Wire.read();
Serial.println(reg_11, HEX);
reg_12=Wire.read();
Serial.println(reg_12, HEX);
Wire.endTransmission(); // stop transmitting

Aren't you supposed to use "Wire.requestFrom(address, size)" to read?

I don't think you should have a "Wire.endTransmission()" after reading.

You should always update comments when things change. Especially when you know that other people will be reading it. You now know that the device is at 0x55.

lsnook:

Wire.beginTransmission(addr); // transmit to device #55 (0x2c)