Smartcar Shield
src
sensors
distance
infrared
analog
InfraredAnalogSensor.hpp
Go to the documentation of this file.
1
7
#pragma once
8
9
#include <stdint.h>
// NOLINT(modernize-deprecated-headers)
10
11
#include "../../../../runtime/Runtime.hpp"
12
#include "../../DistanceSensor.hpp"
13
14
namespace
smartcarlib
15
{
16
namespace
constants
17
{
18
namespace
analogInfraredSensor
19
{
20
const
uint8_t
kDefaultIterations
= 5;
21
}
// namespace analogInfraredSensor
22
}
// namespace constants
23
}
// namespace smartcarlib
24
25
class
InfraredAnalogSensor
:
public
DistanceSensor
26
{
27
public
:
28
InfraredAnalogSensor
(
Runtime
& runtime);
29
30
/* Check `DistanceSensor` interface for documentation */
31
unsigned
int
32
getMedianDistance
(uint8_t iterations
33
=
smartcarlib::constants::analogInfraredSensor::kDefaultIterations
)
override
;
34
35
private
:
36
Runtime
& mRuntime;
37
};
smartcarlib
Definition:
DistanceCar.hpp:11
DistanceSensor
Definition:
DistanceSensor.hpp:20
smartcarlib::constants::analogInfraredSensor::kDefaultIterations
const uint8_t kDefaultIterations
Definition:
InfraredAnalogSensor.hpp:20
Runtime
Definition:
Runtime.hpp:35
InfraredAnalogSensor
Definition:
InfraredAnalogSensor.hpp:25
InfraredAnalogSensor::InfraredAnalogSensor
InfraredAnalogSensor(Runtime &runtime)
Definition:
InfraredAnalogSensor.cpp:12
InfraredAnalogSensor::getMedianDistance
unsigned int getMedianDistance(uint8_t iterations=smartcarlib::constants::analogInfraredSensor::kDefaultIterations) override
Gets the median distance from the specified number of measurements.
Definition:
InfraredAnalogSensor.cpp:17
Generated by
1.8.17