- test driving
This commit is contained in:
2023-10-10 17:06:30 +02:00
parent fd3155f49d
commit 692adf7e16
8 changed files with 38 additions and 31 deletions
+2 -8
View File
@@ -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;