完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,
我需要从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个回答
|
|
你好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 |
|
|
|
嗨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 |
|
|
|
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). |
|
|
|
嗨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# |
|
|
|
嗨,
感谢您的时间奥利,您的回复非常有帮助。 实际上,我正在尝试测试学校项目的惯性测量单元的准确性。这就是我需要从加速度计和陀螺仪获取输出数据的原因。 但首先,我试图利用输出数据打开与加速方向匹配的LED(如陀螺仪的演示)。我在寄存器中将线性加速度范围设置为8g,但我无法确定函数''LSM303DLHC_Read(ACC_I2C_ADDRESS,LSM303DLHC_OUT_X_L_A,6,tmpbuffer)'返回哪种数据。 在数据手册中,提到16位数据输出以2的补码表示。然后将此数据转换为浮点数。缓冲区声明是:float buffer [6]。但是,在我读过的不同程序中,X和Y值由Xval = buffer [0]和Yval = buffer [1]或buffer [2]定义。 但是,我们不应该通过上面的函数获得Xval(参数:LSM303DLHC_OUT_X_L_A)吗?为什么浮点值在8位转换为测试(''if((int8_t)Buffer [0]&lt; -2)'')? 关于数据过滤,我将研究卡尔曼滤波器,谢谢你的想法。 亲切的问候, Antho 以上来自于谷歌翻译 以下为原文 Hi, Thanks for your time Ollie, your reply has been very helpful. Actually, I am trying to test the accuracy of the Inertial Measurement Unit for a school project. That is why I need to get the output data from both the accelerometer and the gyroscope. But first, I am trying to exploit the output data to turn on the LED matching with the acceleration direction (as in the demo of the gyroscope). I set the linear acceleration range at 8g in the register but I have not been able to determine which kind of data is returned by the function ''LSM303DLHC_Read(ACC_I2C_ADDRESS,LSM303DLHC_OUT_X_L_A,6,tmpbuffer)''. In the data sheet, it is mentioned that the 16 bit data output is expressed in 2's complement. this data is then converted into a float. The buffer declaration is : float buffer[6]. However, in the different programs I read, the X and Y values were define by Xval = buffer[0] and Yval = buffer[1] or buffer[2]. But, aren't we supposed to get only the Xval by the function above (parameter : LSM303DLHC_OUT_X_L_A) ? And why is the float value converted in 8 bit for the test (''if((int8_t)Buffer[0] < -2)'') ? About the data filtering, I will look into the Kalman filter, thank you for the idea. Kind regards, Antho |
|
|
|
你好Sudhi,
您是否可以下载所需的软件? 如果没有,请通过thiago.reis@st.com向我发送一条消息,其中包含您的联系信息和项目说明 谢谢, 蒂亚戈 以上来自于谷歌翻译 以下为原文 Hello Sudhi, Were you able to download the software that you needed? If not, please send me a message with your contact information and project description at thiago.reis@st.com Thank you, Thiago |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2642 浏览 1 评论
3208 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1783 浏览 1 评论
3611 浏览 6 评论
5989 浏览 21 评论
940浏览 4评论
1317浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
585浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1304浏览 3评论
1362浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-25 03:12 , Processed in 1.435264 second(s), Total 87, Slave 71 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号