JM9 XRCU Board 0.1.2
Libraries API Reference
Loading...
Searching...
No Matches
Vl53l0x.h
Go to the documentation of this file.
1
8
9#ifndef Vl53l0x_h
10#define Vl53l0x_h
11
12#include <Arduino.h>
13
14#include <Uts_togglable.h>
15
16#include "vl53l0x-arduino/VL53L0X.h"
17
30class Vl53l0x : public Uts_togglable {
31 private:
35 VL53L0X lidar;
36
40 const uint32_t port;
41
45 uint8_t i2c_address;
46
50 static const uint8_t DEFAULT_I2C_ADDRESS;
51
55 static const uint32_t I2C_FREQ;
56
57 public:
63 Vl53l0x (const uint32_t init_port);
64
68 ~Vl53l0x ();
69
75 void re_address_device (const uint8_t new_i2c_address);
76
87 bool begin ();
88
107 bool begin (const uint8_t new_i2c_address);
108
113 void disable ();
114
119 void enable ();
120
127 uint16_t read_dist_mm ();
128};
129
130#endif
Uts_togglable()
Constructor for a togglable ultrasonic sensor driver.
Definition Uts_togglable.cpp:8
Vl53l0x(const uint32_t init_port)
Creates a Vl53l0x object.
Definition Vl53l0x.cpp:11
uint16_t read_dist_mm()
Reads the distance between this VL53L0X sensor and the obstacle in front of it.
Definition Vl53l0x.cpp:102
bool begin()
Activates this VL53L0X sensor.
Definition Vl53l0x.cpp:30
~Vl53l0x()
Destroys this object and releases the occupied resources.
Definition Vl53l0x.cpp:19
void enable()
Re-enables this VL53L0X sensor.
Definition Vl53l0x.cpp:77
void disable()
Teporarily disables this VL53L0X sensor.
Definition Vl53l0x.cpp:70
void re_address_device(const uint8_t new_i2c_address)
Changes the I2C address of this VL53L0X sensor.
Definition Vl53l0x.cpp:23