1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
8x8模式最大可以跑到50Hz,但是要改一下寄存器。
int example17(void){ /// VL53L5CX ranging variables /// uint8_t status, isAlive, isReady, i, j;uint16_t loop;VL53L5CX_Configuration Dev; / Sensor configuration /uint16_t distance[VL53L5CX_RESOLUTION_8X8]; / Array of 64 zones which returns the data /uint32_t timestamp = 0; /// Customer platform /// /* Fill the platform structure with customer's implementation. For this
/* (Optional) Set a new I2C address if the wanted address is different
/ (Optional) Check if there is a VL53L5CX sensor connected /status = vl53l5cx_is_alive( Dev, isAlive);if(!isAlive || status){printf("VL53L5CX not detected at requested addressn");return status;} / (Mandatory) Init VL53L5CX sensor /status = vl53l5cx_init( Dev);if(status){printf("VL53L5CX ULD Loading failedn");return status;} printf("VL53L5CX ULD ready ! (Version : %s)n",VL53L5CX_API_REVISION); /// Set some params /// / Program continuous mode (best one for speed) /status = vl53l5cx_set_ranging_mode( Dev, VL53L5CX_RANGING_MODE_CONTINUOUS); / Change resolution. Use 8x8 for this example, but 4x4 is also supported ///status = vl53l5cx_set_resolution( Dev, VL53L5CX_RESOLUTION_8x8); status = vl53l5cx_set_resolution( Dev, VL53L5CX_RESOLUTION_8X8); / Reduce sharpener. This is mandatory as the signal strength is very low /status = vl53l5cx_set_sharpener_percent( Dev, 0); / Increase max frequency. Dedicated function to be created in the future /uint8_t frequency_hz = 50; // Max 4x4: 150 fps / max 8x8: 50 fpsstatus = vl53l5cx_dci_replace_data( Dev, Dev.temp_buffer,VL53L5CX_DCI_FREQ_HZ, 4,(uint8_t*) frequency_hz, 1, 0x01); /// Ranging loop /// / Use dedicated start ranging function in “plugin_fast_ranging” /status = vl53l5cx_start_fast_ranging( Dev); loop = 0;while(loop < 1000){/* Use polling function to know when a new measurement is ready.
/ Stop the sensor: use dedicated stop ranging function in “plugin_fast_ranging” /status = vl53l5cx_stop_fast_ranging( Dev);printf("End of ULD demon");return status;} |
|
|
|
只有小组成员才能发言,加入小组>>
调试STM32H750的FMC总线读写PSRAM遇到的问题求解?
1817 浏览 1 评论
X-NUCLEO-IHM08M1板文档中输出电流为15Arms,15Arms是怎么得出来的呢?
1631 浏览 1 评论
1103 浏览 2 评论
STM32F030F4 HSI时钟温度测试过不去是怎么回事?
739 浏览 2 评论
ST25R3916能否对ISO15693的标签芯片进行分区域写密码?
1692 浏览 2 评论
1951浏览 9评论
STM32仿真器是选择ST-LINK还是选择J-LINK?各有什么优势啊?
755浏览 4评论
STM32F0_TIM2输出pwm2后OLED变暗或者系统重启是怎么回事?
586浏览 3评论
605浏览 3评论
stm32cubemx生成mdk-arm v4项目文件无法打开是什么原因导致的?
568浏览 3评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-30 18:29 , Processed in 0.954073 second(s), Total 81, Slave 63 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号