| 82 | public: |
| 83 | Potentiometer(int sensor_pin) : mSensorPin(sensor_pin) {} |
| 84 | float Read() { |
| 85 | float avg = 0.0; |
| 86 | // Filter by reading the value multiple times and taking |
| 87 | // the average. |
| 88 | for (int i = 0; i < 8; ++i) { |
| 89 | avg += analogRead(mSensorPin); |
| 90 | } |
| 91 | avg = avg / 8.0f; |
| 92 | return avg; |
| 93 | } |
| 94 | private: |
| 95 | int mSensorPin; |
| 96 | }; |
nothing calls this directly
no test coverage detected