charles macneill
/
VL53L3CX_NoShield_1Sensors_Polling
1 sensory wired directly to the F401. Uses Ayoub's Custom library. Mb6
Diff: main.cpp
- Revision:
- 3:ba1ee6cac90d
- Parent:
- 2:28f78024d00a
diff -r 28f78024d00a -r ba1ee6cac90d main.cpp --- a/main.cpp Wed Jul 21 12:09:20 2021 +0000 +++ b/main.cpp Wed Jul 21 12:10:49 2021 +0000 @@ -122,33 +122,7 @@ wait_ms(POLLING_PERIOD); } } -/* - // repeatedly read data and start next measurement - // Note in VL53L3CX there is only one Zone so NumberOfZones is not used and is always assumed to be 1 - while (1) { - memset( &Result, 0x0,sizeof(RANGING_SENSOR_Result_t)); - status = sensor->VL53L3A2_RANGING_GetDistance(ToF_sensor, &Result); - if ((status == BSP_ERROR_NONE) && - ( Result.ZoneResult[zone].NumberOfTargets != 0)) - { - for ( target = 0 ; target < Result.ZoneResult[0].NumberOfTargets; target++) - { - if (Result.ZoneResult[zone].Status[target] == VL53LX_RANGESTATUS_RANGE_VALID ) - { - printf("\n |---> "); - printf("Status = %d, Target %d, Distance = %5d mm", - Result.ZoneResult[zone].Status[target], - target, - Result.ZoneResult[zone].Distance[target]); - } - } - } - wait_ms(POLLING_PERIOD); - } -} - -*/ /*=================================== Main ================================== =============================================================================*/