Skip to content

Commit d62bfa6

Browse files
add modulino distance doc
1 parent 1254451 commit d62bfa6

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

docs/api.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
| `class` [`ModulinoKnob`](#modulinoknob) | Handles the functionality of Modulino Knob, interfacing with the rotary knob position. |
1212
| `class` [`ModulinoMovement`](#modulinomovement) | Handles the functionality of Modulino Movement,interfacing with the IMU sensor to get acceleration readings. |
1313
| `class` [`ModulinoThermo`](#modulinothermo) | Handles the functionality of Modulino Thermo, managing temperature sensors to provide real-time temperature and humidity readings. |
14-
| `class` [`ModulinoPressure`](#modulinopressure) | Handles the functionality of Modulino Pressure, interfacing with pressure sensors to get atmospheric pressure. |
14+
| `class` [`ModulinoDistance`](#modulinodistance) | Handles the functionality of Modulino Distance, enabling distance measurement using ToF (Time-of-Flight) sensors for precise range detection. |
1515

1616
### ModulinoClass
1717

@@ -132,17 +132,19 @@ Represents a Modulino Thermo module.
132132

133133
---
134134

135-
### ModulinoPressure
135+
### ModulinoDistance
136136

137-
Represents a Modulino Pressure module.
137+
Represents a Modulino Distance module.
138138

139139
#### Methods
140140

141-
- **`float getPressure()`**
142-
Returns the pressure reading.
141+
- **`available()`**
142+
Checks if new distance data is available from the sensor. If data is ready, it reads the data and updates the distance value.
143+
`true` if distance data is available, `false` if distance data is not available.
143144

144-
- **`float getTemperature()`**
145-
Returns the temperature reading.
145+
- **`float get()`**
146+
Returns the distance measured by the sensor in millimeters.
147+
The measured distance in millimeters if available, `NAN` if the distance reading is invalid.
146148

147149
## Constants
148150

docs/readme.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The **Modulino** library supports the following hardware modules:
1818
- **Knob (`ModulinoKnob`)**: Read the value of a rotary encoder.
1919
- **Motion (`ModulinoMovement`)**: Interface with the LSM6DSOX IMU sensor to get acceleration values.
2020
- **Temperature & Humidity (`ModulinoThermo`)**: Get temperature and humidity readings from the HS300x sensor.
21-
- **Pressure (`ModulinoPressure`)**: Get atmospheric pressure readings from the LPS22HB sensor.
21+
- **Distance (`ModulinoDistance`)**: Measures distance using a Time-of-Flight (ToF) sensor (VL53L0x).
2222

2323
## Library Initialization
2424

@@ -93,13 +93,13 @@ float temperature = thermo.getTemperature();
9393
float humidity = thermo.getHumidity();
9494
```
9595

96-
### ModulinoPressure
97-
Reads atmospheric pressure data from the LPS22HB sensor.
96+
### ModulinoDistance
97+
Measures distance using a ToF (Time-of-Flight) sensor.
9898

9999
```cpp
100-
ModulinoPressure pressure;
101-
pressure.begin();
102-
float pressureValue = pressure.getPressure();
100+
ModulinoDistance distance;
101+
distance.begin();
102+
float distanceValue = distance.get();
103103
```
104104

105105
## Example Usage

0 commit comments

Comments
 (0)