Go to the documentation of this file.
11 #include "../../../runtime/Runtime.hpp"
12 #include "../Odometer.hpp"
39 unsigned long pulsesPerMeter);
74 volatile unsigned long mDt{ 0 };
77 const float mMillimetersPerPulse;
79 const bool kSensorAttached;
volatile unsigned long mPulsesCounter
A callback to be invoked. Depending on the platform different callback types may be necessary.
volatile unsigned long mDt
~DirectionlessOdometer() override=default
virtual void update()
Conducts the distance and speed measurements.
const float mPulsesPerMeterRatio
long getDistance() override
Returns the travelled distance in centimeters where sign can indicate direction if there is hardware ...
DirectionlessOdometer(Runtime &runtime, uint8_t pulsePin, InterruptCallback callback, unsigned long pulsesPerMeter)
Constructs an odometer that can measure distance, speed but not direction.
float getSpeed() override
Returns the current speed in meters/sec where sign can indicate direction if there is hardware suppor...
bool isAttached() const override
Returns whether the sensor has been properly attached.
volatile unsigned long mPreviousPulse
virtual void reset()
Resets the total travelled distance and speed to 0
bool providesDirection() const override
Return whether the sensor is capable of inferring the direction of movement.