AM4096 I2C Read

Hello All,

I am trying to get the Sensor Data as i want to use sinusoidal differential analog outputs.I am new to the Arduino I2c programming but i have tried one program but not getting output.Any help would be appericiated.Datasheet Available Here…http://resources.renishaw.com/en/details/data-sheet-am4096-rotary-magnetic-encoder-ic--79188

Thank You.

//i2c_Am4096
#include <Wire.h>
 const int SLAVE_ADDRESS=0x0000;
 int encodercount=0;



void writeRegister1(long thisRegister, long thisValue) {
  long result = 0;   
Wire.beginTransmission (SLAVE_ADDRESS);
  result = Wire.write(thisRegister);
  result = Wire.write(thisValue);
Wire.endTransmission ();
}


void Initencoder()
{

   writeRegister1(0x0001, 0x4000);
   writeRegister1(0x0000, 0x8000);
   writeRegister1(0x0003, 0x0038);
}
void setup() {
 Serial.begin(115200);
Initencoder();

}

void loop() {
 Wire.beginTransmission (SLAVE_ADDRESS);
 Wire.write(0x32);
encodercount = Wire.read ();
encodercount <<= 8;
encodercount|= Wire.read ();
Wire.endTransmission ();
Serial.println(encodercount);
}

Data_sheet_RMK4_evaluation_board.pdf (355 KB)

The slave address 0 is a really stupid idea, this address is reserved for broadcasting, and may not be supported by the Arduino library. Try to program the chip for an address >=8.