Skip to main content
Chris_student
Associate II
October 25, 2023
Solved

lsm303 stm32F407G

  • October 25, 2023
  • 1 reply
  • 1483 views

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

 

This topic has been closed for replies.
Best answer by Chris_student

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

1 reply

Foued_KH
ST Employee
October 25, 2023

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.
Chris_student
Chris_studentAuthorBest answer
Associate II
November 2, 2023

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