2024-08-01 08:25 AM - last edited on 2024-08-02 08:12 AM by Amel NASRI
I want to use the L3GD20 gyroscope on my development board. But I didn't understand what I should do and I couldn't find an example on the internet. I know it communicates via SPI, but I could not send or read data. Can you please help me in detail?
2024-08-01 04:24 PM - edited 2024-08-01 04:25 PM
There is no L3GD20 on that board from what I can tell by the user manual. Do you mean the I3G4250D? Or are you working with an external board with a L3GD20 on it?
2024-08-02 05:18 AM
Sorry, you are right I mean I3G4250D. I figured out the problem, the problem was
hspi2.Init.DataSize = SPI_DATASIZE_8BIT;
SPI_DATASIZE_8BIT was the 4BIT I changed it now I can read the WHO_AM_I value but now I can't read the XYZ axis values. I can get some values but values don't change when I move the sensor.
2024-08-02 06:19 AM
If you can read WHO_AM_I, that confirms the sensor is hooked up and communicating correctly. You are probably not setting up the chip correctly to do more measurements.