cancel
Showing results for 
Search instead for 
Did you mean: 

lsm303 stm32F407G

Chris_student
Associate II

I have some following up questions after my last post: https://community.st.com/t5/stm32-mcus-products/lsm303dlhc-c/m-p/597950#M224881. I now have a code that does not give any errors. with the librarys in the picture below. But when i run the code and call for: BSP_accelero_init(); it returns a 1, this means that the sensor is not found. according to the library the I2C adresses are 32 and 3C, but when i do a I2C scanner on my arduino it says this should be 18 and 1E. After trying those adresses it still does not work. Could enyone help me with this?

Chris_student_0-1698235852918.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

I found out my school gave us chinees fake of the sensor. So we are not using it anymore. But thanks for your help!

View solution in original post

2 REPLIES 2
Foued_KH
ST Employee

Hello @Chris_student , 

The I2C addresses (0x32 and 0x3C) are correct. (from datasheet 5.1.1 section https://www.st.com/resource/en/datasheet/lsm303dlhc.pdf )

You can connect an oscilloscope and check SDA and SCL behavior.

Foued


To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I found out my school gave us chinees fake of the sensor. So we are not using it anymore. But thanks for your help!