Library containing Crazyflie 2.0 sensors drivers: - LPS25H (barometer) - MPU9250 (IMU) - PMW3901 (optical flow) - VL53L0X (range)
Dependents: Drones-Controlador controladoatitude_cteste Drone_Controlador_Atitude optical_test
VL53L0X/VL53L0X.h
- Committer:
- fbob
- Date:
- 2018-09-24
- Revision:
- 11:b3a7164c4e12
- Child:
- 12:2bbe233d25fb
File content as of revision 11:b3a7164c4e12:
#ifndef VL53L0X_h #define VL53L0X_h #include "mbed.h" /** VL53L0X (lidar sensor) class * * Example code (print pressure and altitude data on serial port every 0.2 second): * @code * #include "mbed.h" * #include "USBSerial.h" * #include "VL53L0X.h" * * USBSerial pc; * VL53L0X lidar(PC_9,PA_8); * * int main() * { * if(!lidar.init()) * { * pc.printf("Failed to detect and initialize lidar on I2C bus!"); * while(1); * } * while(1) * { * lidar.read(); * pc.printf("Distance [m]: %6.2f \n\n", lidar.z); * wait(0.2); * } * } * @endcode * (Need to target to NUCLEO-F401RE board platform) */ class VL53L0X { public: /** Class constructor */ VL53L0X(PinName sda, PinName scl); private: /** I2C bus */ I2C i2c; }; #endif