Nora Vazbyte
/
Multi_VL53L0X
Working multi-sensor TOF setup
Diff: main.cpp
- Revision:
- 3:5edb525fae6d
- Parent:
- 2:8758d2437277
--- a/main.cpp Tue Feb 26 19:58:08 2019 +0000 +++ b/main.cpp Wed Feb 27 16:18:33 2019 +0000 @@ -35,7 +35,7 @@ status2 = range2.get_distance(&distance2); if (status1 == VL53L0X_ERROR_NONE) { // printf("Range1 [mm]: %6ld\r\n", distance1); - if (distance1 > 0) { + if (distance1 > 40 && distance1 < 2200) { led1 = 0; } else { @@ -47,12 +47,14 @@ } if (status2 == VL53L0X_ERROR_NONE) { // printf("Range2 [mm]: %6ld\r\n", distance2); + if (distance2 > 40 && distance2 < 2200) { led2 = 0; + } } else { // printf("Range2 [mm]: --\r\n"); led2 = 1; } - wait(0.1); + wait(0.2); } }