ffcvv
Dependencies: vl53l0x_api libxDot-mbed5
Diff: main.cpp
- Revision:
- 2:8ac50bd2c7a1
- Parent:
- 0:b6867e1a23fa
- Child:
- 3:83ec4984a7af
--- a/main.cpp Tue Aug 23 05:19:55 2016 +0000 +++ b/main.cpp Fri Apr 21 11:22:11 2017 +0000 @@ -3,7 +3,8 @@ #include "vl53l0x_platform.h" #include "vl53l0x_i2c_platform.h" -Serial pc(SERIAL_TX, SERIAL_RX); +Serial pc(USBTX, USBRX); +DigitalOut led(LED1); void print_pal_error(VL53L0X_Error Status){ char buf[VL53L0X_MAX_STRING_LENGTH]; @@ -197,7 +198,7 @@ if(Status == VL53L0X_ERROR_NONE) { uint32_t measurement; - uint32_t no_of_measurements = 32; + uint32_t no_of_measurements = 6000; uint16_t* pResults = (uint16_t*)malloc(sizeof(uint16_t) * no_of_measurements); @@ -212,7 +213,8 @@ *(pResults + measurement) = pRangingMeasurementData->RangeMilliMeter; printf("In loop measurement %lu: %d\n", measurement, pRangingMeasurementData->RangeMilliMeter); - + wait(1); + led=!led; // Clear the interrupt VL53L0X_ClearInterruptMask(pMyDevice, VL53L0X_REG_SYSTEM_INTERRUPT_GPIO_NEW_SAMPLE_READY); VL53L0X_PollingDelay(pMyDevice);