1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,
我有一个障碍物距离测量项目,其中使用VL53L1X传感器,微控制器是Atmeag 328.我已经下载了API参考代码。但是有很多文件让我很困惑。我在我的项目中使用过单个传感器。我编写了I2C软件来读取VL53L1X的基本寄存器信息。我能够正确阅读以下寄存器。 型号ID - 0x010F - 读取0xEA是正确的 型号类型 - 0x0110 - 读取正确的0xCC 掩模版本 - 0x0111 - 读取0x10这是正确的 但是为了测量距离,有很多API。如果我使用atmel Microcontroller获得任何示例代码或示例代码,那将非常有用。 请帮助我。 以上来自于谷歌翻译 以下为原文 Hi, I have project for obstacle distance measurement where VL53L1X sensor is used and the microcontroller is Atmeag 328. I have downloaded API reference code. But there are lot of files which is really confusing me. I have used single sensor in my project. I have written software I2C to read basic register information from VL53L1X. I am able read the following registers properly. Model ID - 0x010F - Am reading 0xEA which is correct Model Type - 0x0110 - Am reading 0xCC which is correct Mask Revision - 0x0111 - Am reading 0x10 which is correct But to measure the distance there are lot of API's. It would be really helpful if i get any sample code or example code with atmel Microcontroller. Kindly help me. |
|
相关推荐
2个回答
|
|
你大部分都在那里。现在不要放弃。有一些代码称为X-Cube-vl53l1x。它可以在:
http://www.st.com/content/st_com/en/products/ecosystems/stm32-open-development-environment/stm32cube-expansion-software/stm32-ode-sense-sw/x-cube-53l1a1.html 使用您编写的代码,您已经完成了所有设置。复制来自main.c的调用,它将适合您。 即使您不使用ST处理器,此代码也非常方便。 例如: status = VL53L1_WaitDeviceBooted(Dev); status + = VL53L1_DataInit(Dev); status + = VL53L1_StaticInit(Dev); status + = VL53L1_SetPresetMode(Dev,VL53L1_PRESETMODE_LITE_RANGING); status + = VL53L1_SetDistanceMode(Dev,VL53L1_DISTANCEMODE_MEDIUM); status + = VL53L1_SetMeasurementTimingBudgetMicroSeconds(Dev,20000); // status + = VL53L1_SetInterMeasurementPeriodMilliSeconds(Dev,100); status + = VL53L1_GetMeasurementTimingBudgetMicroSeconds(Dev,& pMeasurementTimingBudgetMicroSeconds); printf('Timing Budget =%d n',pMeasurementTimingBudgetMicroSeconds); status + = VL53L1_StartMeasurement(Dev); 如果(状态){ printf('你有点错误 n'); 而(1); } if(isInterrupt){ 做//中断模式 { __WFI(); if(IntCount!= 0){ IntCount = 0; status = VL53L1_GetRangingMeasurementData(Dev,& RangingData); 如果(状态== 0){ printf('%d,%d,%。2f,%。2f,%d n',RangingData.RangeStatus,RangingData.RangeMilliMeter, RangingData.SignalRateRtnMegaCps / 65536.0,RangingData.AmbientRateRtnMegaCps / 65336.0,HAL_GetTick()); } status = VL53L1_ClearInterruptAndStartMeasurement(Dev); } } 而(1); 以上来自于谷歌翻译 以下为原文 You are most of the way there. Don't quit now. There is a bit of code called X-Cube-vl53l1x. It's available at: http://www.st.com/content/st_com/en/products/ecosystems/stm32-open-development-environment/stm32cube-expansion-software/stm32-ode-sense-sw/x-cube-53l1a1.html With the code you have written, you are all set. Copy the calls from the main.c and it will just work for you. And this code makes a pretty handy reference - even if you don't use an ST processor. For example: status = VL53L1_WaitDeviceBooted(Dev); status += VL53L1_DataInit(Dev); status += VL53L1_StaticInit(Dev); status += VL53L1_SetPresetMode(Dev,VL53L1_PRESETMODE_LITE_RANGING); status += VL53L1_SetDistanceMode(Dev, VL53L1_DISTANCEMODE_MEDIUM); status += VL53L1_SetMeasurementTimingBudgetMicroSeconds(Dev,20000); //status += VL53L1_SetInterMeasurementPeriodMilliSeconds(Dev, 100); status += VL53L1_GetMeasurementTimingBudgetMicroSeconds(Dev, &pMeasurementTimingBudgetMicroSeconds); printf('Timing Budget = %dn', pMeasurementTimingBudgetMicroSeconds);status += VL53L1_StartMeasurement(Dev); if(status){ printf('YOU DID SOMETHING WRONG n'); while(1); } if (isInterrupt){ do // interrupt mode { __WFI(); if(IntCount !=0 ){ IntCount=0; status = VL53L1_GetRangingMeasurementData(Dev, &RangingData); if(status==0){ printf('%d,%d,%.2f,%.2f,%dn', RangingData.RangeStatus,RangingData.RangeMilliMeter, RangingData.SignalRateRtnMegaCps/65536.0,RangingData.AmbientRateRtnMegaCps/65336.0,HAL_GetTick()); } status = VL53L1_ClearInterruptAndStartMeasurement(Dev); } } while(1); |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2730 浏览 1 评论
3239 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1808 浏览 1 评论
3647 浏览 6 评论
6035 浏览 21 评论
1338浏览 4评论
198浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
350浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
442浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
273浏览 2评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 02:41 , Processed in 1.365137 second(s), Total 78, Slave 62 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号