ds
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Fork of VL53L0X by
Diff: VL53L0X.cpp
- Revision:
- 5:0750bf6ea43b
- Parent:
- 3:e9269ff624ed
- Child:
- 6:7bb5d564af90
--- a/VL53L0X.cpp Mon Dec 18 08:27:21 2017 +0000 +++ b/VL53L0X.cpp Wed Apr 11 14:36:06 2018 +0000 @@ -37,6 +37,7 @@ /* Includes */ #include <stdlib.h> +#include <iostream> #include "VL53L0X.h" @@ -73,12 +74,27 @@ #define REF_ARRAY_SPAD_5 5 #define REF_ARRAY_SPAD_10 10 +using namespace std; + uint32_t refArrayQuadrants[4] = {REF_ARRAY_SPAD_10, REF_ARRAY_SPAD_5, REF_ARRAY_SPAD_0, REF_ARRAY_SPAD_5 }; - - +void VL53L0X::laser_portee() { + + uint32_t distance; + int status; + + status = get_distance(&distance); + if (status == VL53L0X_ERROR_NONE) + _distance = distance; + else + cout << ("Portee (mm): Erreur\r") << endl; +} + +void VL53L0X::laser_afficher() const{ + cout << "Portee (mm):" << _distance << endl; +} VL53L0X_Error VL53L0X::VL53L0X_device_read_strobe(VL53L0X_DEV dev) {