ds

Dependencies:   ST_INTERFACES X_NUCLEO_COMMON

Fork of VL53L0X by ST

Revision:
6:7bb5d564af90
Parent:
5:0750bf6ea43b
--- a/VL53L0X.cpp	Wed Apr 11 14:36:06 2018 +0000
+++ b/VL53L0X.cpp	Sat May 05 15:26:12 2018 +0000
@@ -88,12 +88,15 @@
     status = get_distance(&distance);
     if (status == VL53L0X_ERROR_NONE) 
         _distance = distance;
-    else 
-        cout << ("Portee (mm): Erreur\r") << endl;           
+    else {
+        cout << ("\rPortee (mm): Erreur\r") << endl;   
+        _distance = 90000;
+    }        
 }
 
-void VL53L0X::laser_afficher() const{   
-    cout << "Portee (mm):" << _distance << endl;
+uint32_t VL53L0X::laser_afficher() {   
+    cout << "\rPortee (mm):" << _distance << endl;
+    return _distance;
 }
 
 VL53L0X_Error VL53L0X::VL53L0X_device_read_strobe(VL53L0X_DEV dev)