ds
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Fork of VL53L0X by
Revision 6:7bb5d564af90, committed 2018-05-05
- Comitter:
- PeaceBearer
- Date:
- Sat May 05 15:26:12 2018 +0000
- Parent:
- 5:0750bf6ea43b
- Commit message:
- code;
Changed in this revision
| VL53L0X.cpp | Show annotated file Show diff for this revision Revisions of this file |
| VL53L0X.h | Show annotated file Show diff for this revision Revisions of this file |
--- 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)
--- a/VL53L0X.h Wed Apr 11 14:36:06 2018 +0000
+++ b/VL53L0X.h Sat May 05 15:26:12 2018 +0000
@@ -293,7 +293,7 @@
public:
void laser_portee();
-void laser_afficher () const;
+uint32_t laser_afficher ();
/** Constructor
* @param[in] &i2c device I2C to be used for communication
