![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Prints data bits, range status, and distance (mm)
Fork of VL53L1X_Pololu by
Diff: main.cpp
- Revision:
- 1:67ced5a2c689
diff -r 76ea242a637f -r 67ced5a2c689 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Jul 31 23:47:38 2018 +0000 @@ -0,0 +1,17 @@ +#include "VL53L1X.h" + +DigitalOut led1 (LED1); +DigitalOut led2 (LED2); +VL53L1X L (D14, D15); + +int main() { + led1 = !led1; + L.init(); + + while (1) { + L.startContinuous(10); + printf("Distance (mm): %d\n", L.read()); + L.stopContinuous(); + wait_ms(.500); + } +} \ No newline at end of file