I use Raspberry Pi Zero W.
I followed the instruktion at github to install Python library.
I try to run example ./accelerometer.py and ./magnetometer.py and get the following error:
pi@Constantius:~/lsm303d-python/examples ./accelerometer.py
Traceback (most recent call last):
File "./accelerometer.py", line 9, in <module>
xyz = lsm.accelerometer()
File "/usr/local/lib/python2.7/dist-packages/lsm303d/__init__.py", line 433, in accelerometer
self.setup()
File "/usr/local/lib/python2.7/dist-packages/lsm303d/__init__.py", line 371, in setup
raise RuntimeError("Unable to find lsm303d on 0x{:02x}, IOError".format(self._i2c_addr))
RuntimeError: Unable to find lsm303d on 0x1e, IOError
pi@Constantius:~/lsm303d-python/examples ./magnetometer.py
Traceback (most recent call last):
File β./magnetometer.pyβ, line 9, in
xyz = lsm.magnetometer()
File β/usr/local/lib/python2.7/dist-packages/lsm303d/init.pyβ, line 421, in magnetometer
self.setup()
File β/usr/local/lib/python2.7/dist-packages/lsm303d/init.pyβ, line 371, in setup
raise RuntimeError(βUnable to find lsm303d on 0x{:02x}, IOErrorβ.format(self._i2c_addr))
RuntimeError: Unable to find lsm303d on 0x1e, IOError
pi@Constantius:~/lsm303d-python/examples $
I also run i2cdetcct -y 1 and get:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: β -- β -- β -- β -- β -- β -- β
10: β -- β -- β -- β -- β -- β -- β 1d β --
20: β -- β -- β -- β -- β -- β -- β -- β --
30: β -- β -- β -- β -- β -- β -- β -- β --
40: β -- β -- β -- β -- β -- β -- β -- β --
50: β -- β -- β -- β -- β -- β -- β -- β --
60: β -- β -- β -- β -- β -- β -- β -- β --
70: β -- β -- β -- β --
Why does the program do not find lsm303d?