ST意法半导体
直播中

刘政玮

7年用户 196经验值
私信 关注
[问答]

如何使用LSM303DLHC加速度计的示例

嗨,


我需要从LSM303DLHC读取加速度计数据。我使用STM32F401 Discovery板和''stm32f401_discovery_lsm303dlhc.c''库。
我仔细阅读了数据表,特别是第24页的7.1节,注册设置,但我想知道是否有人有任何项目示例可以帮助我理解如何使用传感器。

先谢谢你。

亲切的问候,

Antho

以上来自于谷歌翻译


以下为原文




Hi,


I need to read the accelerometer data from LSM303DLHC. I use the STM32F401 Discovery board and the ''stm32f401_discovery_lsm303dlhc.c'' library.
I read carefully the datasheet, especially the section 7.1 in page 24 with the register setup but I would like to know if someone has any project example that could help me to understand how to use the sensor.

Thank you in advance.

Kind regards,

Antho

回帖(6)

张鑫

2018-9-29 11:15:46
你好Antho,
 
 
 我们目前正在创建该论坛的一部分,其中包含使用ST的MEMS的应用示例。我也将为您的应用程序添加一个示例。
 
 一旦我们有了代码,我也可以在这里作为参考发布。
 
 非常感谢你,
 
 蒂亚戈雷斯

以上来自于谷歌翻译


以下为原文





Hello Antho,


We are currently creating a section of this forum to contain examples of applications using ST's MEMS. I will add one example for you application too.

Once we have the codes, I can also post it here as a reference.

Thank you very much,

Thiago Reis
举报

刘政玮

2018-9-29 11:32:42
嗨Thiago,
 
 
感谢您的时间。我认为这个新部分是一个好主意,对我这样的初学者来说可能非常有用。
 
Antho

以上来自于谷歌翻译


以下为原文





Hi Thiago,


Thank you for your time. I think that this new section is a good idea, it might be very helpful for beginners like me.

Antho
举报

陈芮雪

2018-9-29 11:41:36
Antho,
 
 如果您仍在查看有关LSM303使用情况的其他信息,我建议您查看F401演示文件夹中的selftest.c文件。您可以使用I2C连接读取传感器数据(例如LSM303DHLC_CompassReadAcc)。获得加速度计和罗盘数据后,应将其与陀螺仪数据(来自L3GD20)相结合。
 
 加速度计有很多短期噪音,但长期稳定性好。陀螺仪噪音很小,但漂移很差。您可以使用卡尔曼滤波器来组合数据流,简单的低通和高通滤波器,或者附加方法(例如基于模型的偏差调整)。

以上来自于谷歌翻译


以下为原文






Antho,

Just in case that you are still looking some additional information about the LSM303 usage, I would recommend that you look the selftest.c file in the F401 demonstration folder.  There you have the code to read the sensor data (such as LSM303DHLC_CompassReadAcc) using the I2C connection.  Once you have the accelerometer and compass data, you should combine that with the gyro data (from L3GD20).

The accelerometer has a lot of short term noise, but good long term stability.  The gyro has little noise, but it has a bad drift.  You can use a Kalman filter to combine the data streams, simple low pass and high pass filters, or add-hoc methods (such as model based bias adjustment).
举报

孙奕

2018-9-29 11:52:58
嗨Thiago,
 
 很高兴知道您正在为应用程序添加单独的部分。
 链接http://www.st.com/web/en/catalog/tools/PF257534#

以上来自于谷歌翻译


以下为原文





Hi Thiago,

Good to know that you are adding a separate section for the applications.
The link http://www.st.com/web/en/catalog/tools/PF257534#
举报

更多回帖

发帖
×
20
完善资料,
赚取积分