Smartcar Shield
Loading...
Searching...
No Matches
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
14namespace smartcarlib
15{
16namespace constants
17{
18namespace analogInfraredSensor
19{
20const uint8_t kDefaultIterations = 5;
21} // namespace analogInfraredSensor
22} // namespace constants
23} // namespace smartcarlib
24
26{
27public:
28 explicit InfraredAnalogSensor(Runtime& runtime);
29
30 /* Check `DistanceSensor` interface for documentation */
31 unsigned int
32 getMedianDistance(uint8_t iterations
34
35private:
36 Runtime& mRuntime;
37};
A parent class for all sensors that conduct distance measurements.
An abstract class to represent the various infrared analog sensors.
unsigned int getMedianDistance(uint8_t iterations=smartcarlib::constants::analogInfraredSensor::kDefaultIterations) override
Gets the median distance from the specified number of measurements.
An interface to serve as a wrapper for the native runtime environment, greatly inspired by the Arduin...
Definition Runtime.hpp:36