Reading GY-81 BMA180 accelerometer control registers

Hi Everyone,

I develop vibrometer application (https://bitbucket.org/Bangybug/vibrometer) and I have GY-81 board to evaluate. That board has BMA180 accelerometer. So I downloaded the test sketch from the internet.

I put that sketch here: https://bitbucket.org/Bangybug/vibrometer/src/6b59265c481abdacb1c31d538589fbc8b3d12c88/arduino/BMA180_Accelerometer_Test/BMA180_Accelerometer_Test.ino?at=master&fileviewer=file-view-default

Before running that sketch I also ran i2c scanner sketch, it has returned 0x38 address for the accelerometer. That address was different to the 0x40 address that was in the downloaded sketch, so I changed it to 0x38.

After that, the said sketch has started to work and report meaningful data.

Then I wanted to read a control register, so I put these lines in to the test sketch:

  delay(300);
  readFrom(BMA180_ADDRESS, BMA180_BW,1,temp);
  Serial.print("Read test: bw=");
  Serial.println(temp[0]);

The result was 0xff - all bits have been read as ones, which is not what I expected.

If you own that board, could you try my sketch and see if you can read back a control register?

Sorry, I just discovered I have BMA020 on that board, by coincidence it was compatible with BMA180 in the data registers, but all other registers are different.