完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我见过的所有示例代码都通过轮询相应的寄存器来读取加速度和磁场值。
例如: x.l = i2c_read(OUT_X_L_A); x.h = i2c_read(OUT_X_H_A); y.l = i2c_read(OUT_Y_L_A); y.h = i2c_read(OUT_Y_H_A); z.l = i2c_read(OUT_Z_L_A); z.h = i2c_read(OUT_Z_H_A); 传感器何时更新寄存器值?我怎么知道何时读取寄存器? 我担心芯片可以在轮询OUT_X_L_A和OUT_X_L_H之间更新寄存器值,从而导致读取损坏。 谢谢, 特拉维斯 以上来自于谷歌翻译 以下为原文 All the example code I've seen reads the acceleration and magnetic field values by polling the appropriate registers. For example: x.l = i2c_read(OUT_X_L_A); x.h = i2c_read(OUT_X_H_A); y.l = i2c_read(OUT_Y_L_A); y.h = i2c_read(OUT_Y_H_A); z.l = i2c_read(OUT_Z_L_A); z.h = i2c_read(OUT_Z_H_A); When does the sensor update the register values? How do I know when to read the registers? I am concerned that the chip could update the register value between polling the OUT_X_L_A and OUT_X_L_H, resulting in a corrupt reading. Thanks, Travis |
|
相关推荐
1个回答
|
|
特拉维斯你好,
为避免出现此类问题,请在附件数据表中查看以下参数: CTRL1(20h) - BDU参数 BDU阻止加速和磁数据的数据更新。默认值:0(0:连续更新; 1:输出寄存器未更新,直到读取了MSB和LSB)。 非常感谢你, 蒂亚戈 以上来自于谷歌翻译 以下为原文 Hello Travis, In order to avoid an issue like this, please check on the attached datasheet the following parameters: CTRL1 (20h) - BDU Parameter BDU Block data update for acceleration and magnetic data. Default value: 0 (0: continuous update; 1: output registers not updated until MSB and LSB have been read). Thank you very much, Thiago |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
1629 浏览 1 评论
2317 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1522 浏览 1 评论
2911 浏览 6 评论
5405 浏览 21 评论
401浏览 4评论
691浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
298浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
750浏览 3评论
641浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-5-16 16:07 , Processed in 1.035711 second(s), Total 81, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号