sedgwickc / BBB_LSM303

A C++ driver for the LSM303 accelerometer and magnetometer sensor written for the BeagleBone Black.
3 stars 1 forks source link

I2C: Failed to read/write to the device. Could not find a valid LSM303! #1

Closed sedgwickc closed 8 years ago

sedgwickc commented 8 years ago

Commit 6722caf

Compiles via make but the following error occurs:

I2C: Failed write to the device : Remote I/O error I2C: Failed to write to the device : Remote I/O error I2C: Failed to read in the value. : Remote I/O error Could not find a valid LSM303!

I double checked that the sensor was visible via i2cdetect.

sedgwickc commented 8 years ago

Commit 9ef2d09

I replaced the address defines copied from the Adafruit Arduino code with the actual address values. The defines were bit-shifting hardcoded values to get the addresses for the sensors. Also, ensure that the program is run with superuser permissions in order to access the I2C bus.