From bcdce9633dc351d3bc7f347a165348b8fab87cd9 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 15 Feb 2022 12:33:52 +0100 Subject: refactor: reorganize files & improve classes --- src/sensor/sensor.hpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'src/sensor/sensor.hpp') diff --git a/src/sensor/sensor.hpp b/src/sensor/sensor.hpp index 3e56627..7b76ae2 100644 --- a/src/sensor/sensor.hpp +++ b/src/sensor/sensor.hpp @@ -1,7 +1,7 @@ #pragma once -#include "utils/serial.hpp" -#include "utils/time.hpp" +#include "serial.hpp" +#include "std/time.hpp" #include #include @@ -77,52 +77,52 @@ public: /** * Returns the current X axis acceleration in g:s (g-force). */ - double getAccelX(); + double getAccelX() const; /** * Returns the current Y axis acceleration in g:s (g-force). */ - double getAccelY(); + double getAccelY() const; /** * Returns the current Z axis acceleration in g:s (g-force). */ - double getAccelZ(); + double getAccelZ() const; /** * Returns the current X angle. */ - double getAngleX(); + double getAngleX() const; /** * Returns the current Y angle. */ - double getAngleY(); + double getAngleY() const; /** * Returns the current X axis in degrees/s. */ - double getGyroX(); + double getGyroX() const; /** * Returns the current Y axis in degrees/s. */ - double getGyroY(); + double getGyroY() const; /** * Returns the current Z axis in degrees/s. */ - double getGyroZ(); + double getGyroZ() const; /** * Returns the current pitch angle. */ - double getPitch(); + double getPitch() const; /** * Returns the current roll angle. */ - double getRoll(); + double getRoll() const; /** * Sets the value of a key in the sensor's register. @@ -157,6 +157,7 @@ public: private: TwoWire _wire; + SerialStream _sout; uint8_t _address; @@ -193,6 +194,4 @@ private: double _yaw = 0; int16_t _readHighLow(); - - SerialStream _sout; }; -- cgit v1.2.3-18-g5258