完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
亲爱的先生,
我想从LIS3DH读取X,Y,Z数据。我已经浏览了同样的数据表,但仍然不明白访问它的命令是什么。如果你告诉我读取数据的命令或算法,那将是你的一种。 问候, Manoj Hiwarkar 以上来自于谷歌翻译 以下为原文 Dear sir, I want to read X,Y,Z data from LIS3DH. I have gone through the datasheet of the same but still didn't understand what are the commands to access it. So it will be kind of you if you tell me the commands or algorithm to read the data. Regards, Manoj Hiwarkar |
|
相关推荐
4个回答
|
|
|
您与用于读取器件内部寄存器的总线上的器件进行交互,数据表应列出寄存器位置和内容。如何连接到您的微控制器将影响您访问它的方式。
如果您不熟悉微控制器和接口,可能会有关于此类事情的书籍或课程。 HAL / CUBE版本中有各种STM32平台的示例驱动程序: STM32Cube_FW_F4_V1.18.0 DRIVERS BSP 组件 lis3dsh lis3dsh.c STM32Cube_FW_F4_V1.18.0 DRIVERS BSP 组件 l3gd20 l3gd20.c 我认为网络搜索会产生更多的例子 以上来自于谷歌翻译 以下为原文 You interact with the part on the bus you're using to read the internal registers in the device, the data sheet should enumerate the register locations and content. How it is wired to your micro-controller will impact how you access it. If you are unfamiliar with micro-controllers and interfacing there are likely books or courses on such things. There are example drivers for various STM32 platforms in the HAL/CUBE releases: STM32Cube_FW_F4_V1.18.0DriversBSPComponentslis3dshlis3dsh.c STM32Cube_FW_F4_V1.18.0DriversBSPComponentsl3gd20l3gd20.c I'd imagine a web search would yield many more examples |
|
|
|
|
|
我使用的是nrf 52832.我们有这个驱动程序吗?
以上来自于谷歌翻译 以下为原文 I am using nrf 52832. do we have any driver for this ? |
|
|
|
|
|
我个人,没有。
你有没有通过SPI或I2C连接?该平台上那些接口的标准驱动程序应该能够访问设备中的寄存器。以上STM32上的示例代码在SPI / I2C之上的级别进行抽象。这可能是可移植的,或者您可能会使用LIS3DH找到您更喜欢飞行控制器或INS实现的代码 / ** * @brief阅读LIS3DSH设备ID。 * @param无 * @retval设备ID(两个字节)。 * / uint8_t LIS3DSH_ReadID(void) { uint8_t tmp = 0; / *配置低级接口* / ACCELERO_IO_Init(); / *阅读WHO_AM_I注册* / ACCELERO_IO_Read(& tmp,LIS3DSH_WHO_AM_I_ADDR,1); / *返回ID * / return(uint16_t)tmp; } 以上来自于谷歌翻译 以下为原文 Me personally, no. Do you have it connected via SPI or I2C? Standard drivers for those interfaces on that platform should be able to access the registers within the device. The example code on the STM32 above is abstracted at the level above the SPI/I2C. This might be portable, or you might find code you like better for a Flight Controller or INS implementation, using the the LIS3DH /** * @brief Read LIS3DSH device ID. * @param None * @retval The Device ID (two bytes). */ uint8_t LIS3DSH_ReadID(void) { uint8_t tmp = 0; /* Configure the low level interface */ ACCELERO_IO_Init(); /* Read WHO_AM_I register */ ACCELERO_IO_Read(&tmp, LIS3DSH_WHO_AM_I_ADDR, 1); /* Return the ID */ return (uint16_t)tmp; } |
|
|
|
|
|
是的,我们通过i2c连接了它
在2018年5月12日星期六,下午4:41 Clive One,< st-microelectronics@jiveon.com> 以上来自于谷歌翻译 以下为原文 Yes we have connected it via i2c On Sat 12 May, 2018, 4:41 PM Clive One, |
|
|
|
|
只有小组成员才能发言,加入小组>>
stm32mp157的异核通信的rpmsg_sdb的m4固件和a7驱动该如何编写?
1472 浏览 0 评论
stm32f103用freertos对一个采样率为1kHz的传感器,进行采样,数据出差
1524 浏览 0 评论
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
3674 浏览 1 评论
3864 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
2483 浏览 1 评论
STM32H7打开DCache后,出现了串口接收信息为空的现象,是哪里出了问题?
752浏览 5评论
用NANO STM32F103RBT6的开发板烧录不了是哪里出了问题?
685浏览 5评论
730浏览 5评论
外部中断触发类型为双边沿触发,进入中断回调后有什么办法判断该边沿是上升沿还是下降沿?
976浏览 5评论
STM32L071CBT6低温环境下无法正常工作是什么原因引起的?
779浏览 5评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-14 22:48 , Processed in 0.845151 second(s), Total 50, Slave 43 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1838