13#include "../../../../runtime/Runtime.hpp"
14#include "../../DistanceSensor.hpp"
61 const uint8_t kTriggerPin;
62 const uint8_t kEchoPin;
63 const unsigned int kMaxDistance;
64 const unsigned long kTimeout;
66 bool mAttached{
false };
67 const uint8_t kOutput;
A parent class for all sensors that conduct distance measurements.
An interface to serve as a wrapper for the native runtime environment, greatly inspired by the Arduin...
The SR04 (aka SRF05) is an inexpensive ultrasonic sensor controllable over two digital pins.
unsigned int getMedianDistance(uint8_t iterations=smartcarlib::constants::sr04::kDefaultIterations) override
Gets the median distance from the specified number of measurements.
unsigned int getDistance() override
Gets the distance measured by the sensor in centimeters.
const uint8_t kDefaultIterations
const unsigned int kError
const unsigned int kDefaultMaxDistance