Detected people approaching if the distance is < 6 feet then LEDs blinking RED otherwise LEDs light green.
Dependencies: mbed X_NUCLEO_53L1A1_mbed WS2812
Diff: main.cpp
- Revision:
- 1:092ee96f479a
- Parent:
- 0:ea8694e55809
--- a/main.cpp Tue Sep 29 09:30:43 2020 +0000 +++ b/main.cpp Sun Nov 01 20:23:28 2020 +0000 @@ -73,10 +73,9 @@ sensor= NULL; printf("Sensor centre not present\n\r"); } - status = sensor->vl53l1x_set_distance_mode(1); // short distance mode better ambient immunity status = sensor->vl53l1x_set_timing_budget_in_ms(100); // good trade off between accuracy and power consumption status = sensor->vl53l1x_set_inter_measurement_in_ms(500); // perform one ranging every second - status = sensor->vl53l1x_set_distance_threshold(1100, 1100, 0, 0); // interrupt if distance < 1.1 m + status = sensor->vl53l1x_set_distance_threshold(1900, 1900, 0, 0); // interrupt if distance < 1.9 m (~6 feet) status = start_ranging(); if (status != 0) { printf("Failed to start ranging!\r\n");