DeskControl/src/lib/vl53l0x.h

37 lines
743 B
C++

/*
The Adafruit VL53L0X library is included because it's an easy way to get
access to the VL53L0X API headers. I will not be using the Adafruit library
however because it lacks a way to set the timing budget, which I found to be
very much required for accurate results.
*/
#ifndef __vl53l0x
#define __vl53l0x
#include "Arduino.h"
#include "Wire.h"
#include "vl53l0x_api.h"
// TODO if begin fails, return a struct with the step and API status code
#define VL53L0X_BEGIN_SUCCESS 0
#define VL53L0X_BEGIN_SUCCESS 0
class VL53L0X
{
public:
bool init(uint8_t address);
// TODO set timing budget
bool getSingleRangingMeasurement(VL53L0X_RangingMeasurementData_t* data);
private:
VL53L0X_Dev_t device;
};
#endif