summaryrefslogtreecommitdiff
path: root/src/sensor/sensor.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-02-15 12:33:52 +0100
committerHampusM <hampus@hampusmat.com>2022-02-15 12:33:52 +0100
commitbcdce9633dc351d3bc7f347a165348b8fab87cd9 (patch)
tree88c2f5d8f0c5fac2bca28e4b543e5209f3bc98fb /src/sensor/sensor.hpp
parent917adc6a2b6b166e37fc3d4f94b41488f0c245a5 (diff)
refactor: reorganize files & improve classes
Diffstat (limited to 'src/sensor/sensor.hpp')
-rw-r--r--src/sensor/sensor.hpp27
1 files changed, 13 insertions, 14 deletions
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 <Arduino.h>
#include <Wire.h>
@@ -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;
};