9 years, 7 months ago.

LSM303D accelerometer attempt to read

Hello, I have a LSM303D 3D accelerometer and 3D magnetometer. It is a I2C slave.

I am trying to get familiar with it, so I tried to read the z axis acceleration.

I wrote the script attached (reading.cpp) and put it in my Nucleo board. /media/uploads/Satanello/reading.cpp

Unfortunately the terminal reads:

data is: 0.

What wrong did I do?

Thanks!

Be the first to answer this question.