- todos
- test driving
This commit is contained in:
@@ -59,13 +59,6 @@ class Speedometer : public Component {
|
||||
*/
|
||||
void setDirection(Direction dir);
|
||||
|
||||
/**
|
||||
* @brief Set the number of last values to be taken into account for the average.
|
||||
*
|
||||
* @param val length of the array
|
||||
*/
|
||||
void setNumOfValForAvg(uint8_t val);
|
||||
|
||||
/**
|
||||
* @brief Set the Enc Filter to prevent bouncing
|
||||
*
|
||||
@@ -88,6 +81,7 @@ class Speedometer : public Component {
|
||||
* @return double speed in m/s
|
||||
*/
|
||||
double getSpeed() const { return this->speed; }
|
||||
double getSpeedRad() const { return this->rad; };
|
||||
double getAvgSpeed() const;
|
||||
|
||||
/**
|
||||
@@ -111,7 +105,6 @@ class Speedometer : public Component {
|
||||
|
||||
private:
|
||||
void run() override;
|
||||
void init(uint8_t pin, double diameter, uint16_t steps);
|
||||
void clearAvgBuf();
|
||||
void addValToBuf(int16_t val);
|
||||
int16_t calcAverage() const;
|
||||
@@ -126,6 +119,7 @@ class Speedometer : public Component {
|
||||
bool calibrationRunning = false;
|
||||
|
||||
double speed = 0;
|
||||
double rad = 0;
|
||||
double diameter;
|
||||
|
||||
uint8_t printCounter = 0;
|
||||
|
||||
Reference in New Issue
Block a user