ZotBins Core
Loading...
Searching...
No Matches
Distance.hpp
Go to the documentation of this file.
1
8
9
#ifndef DISTANCE_HPP
10
#define DISTANCE_HPP
11
12
#include "
ultrasonic.h
"
13
#include <cstdint>
14
#include <driver/gpio.h>
15
#include <esp_intr_alloc.h>
16
#include <freertos/FreeRTOS.h>
17
18
namespace
Fullness
19
{
23
class
Distance
24
{
25
26
public
:
27
// /**
28
// * @brief Construct a new Distance object (init with trigger and echo)
29
// */
30
// Distance(gpio_num_t trigger, gpio_num_t echo, float max_distance_cm); // TODO: NEED TO OVERLOAD CONSTRUCTOR TO SUPPORT MAX_DISTANCE
31
35
Distance
(gpio_num_t trigger, gpio_num_t echo);
36
41
float
getDistance
();
42
43
private
:
44
const
ultrasonic_sensor_t
sensor;
45
float
max_distance_cm = 100;
46
};
47
}
48
49
#endif
Fullness::Distance::Distance
Distance(gpio_num_t trigger, gpio_num_t echo)
Construct a new Distance object (init with trigger and echo)
Definition
Distance.cpp:10
Fullness::Distance::getDistance
float getDistance()
Returns the distance of the sensor.
Definition
Distance.cpp:15
ultrasonic_sensor_t
Definition
ultrasonic.h:59
ultrasonic.h
components
FullnessComponent
include
Distance.hpp
Generated by
1.13.2