59 uint8_t forwardWhenLowPin,
61 unsigned long pulsesPerMeter);
83 unsigned long pulsesPerMeter);
86 void reset()
override;
113 const uint8_t mDirectionPin;
115 const int kPinStateWhenForward;
116 volatile unsigned long mNegativePulsesCounter{ 0 };
117 volatile int mDirectionPinState;
A class to represent directional Odometers.
void update() override
Conducts the distance and speed measurements.
bool providesDirection() const override
Return whether the sensor is capable of inferring the direction of movement.
long getDistance() override
Returns the travelled distance in centimeters where sign can indicate direction if there is hardware ...
int8_t getDirection() const
Get the direction of movement.
void reset() override
Resets the total travelled distance and speed to 0
float getSpeed() override
Returns the current speed in meters/sec where sign can indicate direction if there is hardware suppor...
A class to represent the common - directionless - Odometers (speed encoders) that can be used to prim...
A callback to be invoked.
An interface to serve as a wrapper for the native runtime environment, greatly inspired by the Arduin...
Helper class to represent directional odometer pins.
DirectionalOdometerPins(uint8_t pulsePin, uint8_t forwardWhenLowPin)
Construct a DirectionalOdometerPins object.