1#ifndef TACHOMETER_JENCODER_H
2#define TACHOMETER_JENCODER_H
3#include "JEncoder/JEncoder.h"
6#include <RunningAverage.h>
14 RunningAverage smoother;
24 : smoother(numSavedForSmoothing + 1)
31 return smoother.getAverage();
36 smoother.addValue(
encoder.getVel());
Defines an interface for measuring the frequency, rotational speed, or voltage of a generator to use ...
Definition: Measurement.h:6
This class measures the speed of a generator using a tachometer.
Definition: TachometerJEncoder.h:11
void run()
call this in loop() since some forms of measurement may need to be constantly polled
Definition: TachometerJEncoder.h:33
JEncoder & encoder
Definition: TachometerJEncoder.h:17
float getMeasurement()
Use this method to get the most recent measurement on the speed of the generator.
Definition: TachometerJEncoder.h:29
TachometerJEncoder(JEncoder &_encoder, uint16_t numSavedForSmoothing=0)
This class measures the speed of a generator using any JEncoder from the JMotor library.
Definition: TachometerJEncoder.h:23