Unfortunately it does not seem to help... I changed the seqence of the test to z-y-x and changed the delay after every softreset to 0.01: def selftest(self): self.bus.write_byte_data(self.address, 0x14, 0xB6) time.sleep(0.01) self.bus.write_byte_data(self.address, 0x32, 0x03) time.sleep(0.3) data_z_pos = self.bus.read_i2c_block_data(self.address, 0x06, 2) # Convert the data to 10 bits Accl_z_pos = (data_z_pos[1] * 256 + (data_z_pos[0] & 0xC0)) / 64 if Accl_z_pos > 511 : Accl_z_pos -= 1024 self.bus.write_byte_data(self.address, 0x14, 0xB6) time.sleep(0.01) self.bus.write_byte_data(self.address, 0x32, 0x07) time.sleep(0.3) data_z_neg = self.bus.read_i2c_block_data(self.address, 0x06, 2) # Convert the data to 10 bits Accl_z_neg = (data_z_neg[1] * 256 + (data_z_neg[0] & 0xC0)) / 64 if Accl_z_neg > 511 : Accl_z_neg -= 1024 self.bus.write_byte_data(self.address, 0x14, 0xB6) time.sleep(0.01) self.bus.write_byte_data(self.address, 0x32, 0x02) time.sleep(0.3) data_y_pos = self.bus.read_i2c_block_data(self.address, 0x04, 2) # Convert the data to 10 bits Accl_y_pos = (data_y_pos[1] * 256 + (data_y_pos[0] & 0xC0)) / 64 if Accl_y_pos > 511 : Accl_y_pos -= 1024 self.bus.write_byte_data(self.address, 0x14, 0xB6) time.sleep(0.01) self.bus.write_byte_data(self.address, 0x32, 0x06) time.sleep(0.3) data_y_neg = self.bus.read_i2c_block_data(self.address, 0x04, 2) # Convert the data to 10 bits Accl_y_neg = (data_y_neg[1] * 256 + (data_y_neg[0] & 0xC0)) / 64 if Accl_y_neg > 511 : Accl_y_neg -= 1024 self.bus.write_byte_data(self.address, 0x14, 0xB6) time.sleep(0.01) self.bus.write_byte_data(self.address, 0x32, 0x01) time.sleep(0.03) data_x_pos = self.bus.read_i2c_block_data(self.address, 0x02, 2) # Convert the data to 10 bits Accl_x_pos = (data_x_pos[1] * 256 + (data_x_pos[0] & 0xC0)) / 64 if Accl_x_pos > 511 : Accl_x_pos -= 1024 self.bus.write_byte_data(self.address, 0x14, 0xB6) time.sleep(0.01) self.bus.write_byte_data(self.address, 0x32, 0x05) time.sleep(0.03) data_x_neg = self.bus.read_i2c_block_data(self.address, 0x02, 2) # Convert the data to 10 bits Accl_x_neg = (data_x_neg[1] * 256 + (data_x_neg[0] & 0xC0)) / 64 if Accl_x_neg > 511 : Accl_x_neg -= 1024 self.bus.write_byte_data(self.address, 0x14, 0xB6) time.sleep(0.01) return Accl_x_pos, Accl_x_neg, Accl_y_pos, Accl_y_neg, Accl_z_pos, Accl_z_neg the results of the few runs I did for +x, -x, +y, -y, +z, -z order (in many seqences) are as follows: nvidia@tegra-ubuntu:~/Downloads$ sudo python3 imu.py IMU operation - Please choose CALIB or SELFTEST or READ SELFTEST selftest acc results: -59.0 85.0 -220.0 283.0 146.0 356.0 nvidia@tegra-ubuntu:~/Downloads$ sudo python3 imu.py IMU operation - Please choose CALIB or SELFTEST or READ SELFTEST selftest acc results: -59.0 84.0 -219.0 286.0 147.0 359.0 nvidia@tegra-ubuntu:~/Downloads$ sudo python3 imu.py IMU operation - Please choose CALIB or SELFTEST or READ SELFTEST selftest acc results: -61.0 84.0 -221.0 285.0 147.0 359.0 nvidia@tegra-ubuntu:~/Downloads$ Same type of results is for another BMA250 accelerometer I tried... what do you suggest?
... View more