diff options
author | HampusM <hampus@hampusmat.com> | 2022-02-14 10:11:32 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-02-14 10:11:32 +0100 |
commit | 7892ef9d248c189be68ce7faf63230ec0a318b67 (patch) | |
tree | 7c3d07779d5ce96994f81c0cc22e8b667601ee9d /src/calibration.hpp | |
parent | a03dfe959fcafd238119bdf7f27c07b92064496e (diff) |
refactor: reorganize & add debugging
Diffstat (limited to 'src/calibration.hpp')
-rw-r--r-- | src/calibration.hpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/calibration.hpp b/src/calibration.hpp index 79b3758..e66b6fc 100644 --- a/src/calibration.hpp +++ b/src/calibration.hpp @@ -1,7 +1,9 @@ #ifndef CALIBRATION_HPP #define CALIBRATION_HPP -#include "sensor.hpp" +#include "sensor/sensor.hpp" +#include "utils/memory.hpp" +#include "utils/serial.hpp" // Calibration precision #define ACCEL_CAL_X_MAX 0.006 @@ -37,8 +39,9 @@ public: * Sensor calibrator. * * @param sensor A sensor to calibrate + * @param sout A Serial output stream */ - SensorCalibrator(Sensor *sensor); + SensorCalibrator(unique_ptr<Sensor> &sensor, SerialStream sout); /** * Calibrates the sensor. @@ -57,7 +60,9 @@ private: void _adjustCalibration(); - Sensor *_sensor; + unique_ptr<Sensor> &_sensor; + + SerialStream _sout; float _accel_x; float _accel_y; |