From 4fdb27130e3c53c9a55cc73b8975aae733a03e90 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 23 Nov 2021 13:58:00 +0100 Subject: feat: make basic stuff work --- gyroscope.hpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'gyroscope.hpp') diff --git a/gyroscope.hpp b/gyroscope.hpp index 627aa8c..b57eafa 100644 --- a/gyroscope.hpp +++ b/gyroscope.hpp @@ -17,21 +17,18 @@ namespace RegisterAddresses const int OUT_X_L = 0x28; } -class ReadGyroscopeData -{ -public: - int16_t x, y, z; -}; - class Gyroscope { public: - int gyroscope_id; - Gyroscope(int gyroscope_id); - ReadGyroscopeData read(); - void writeRegistry(uint8_t registry, uint8_t value); + void setup(int id); + void readCoordinates(int16_t *x, int16_t *y, int16_t *z); + void writeRegistry(int8_t registry, int8_t value); static int initialize(); - static int testRegistry(int gyroscope_id, uint8_t registry); + static int testRegistry(int gyroscope_id, int8_t registry); + +private: + int _gyroscope_id; + int16_t _read_next_coordinate(); }; #endif \ No newline at end of file -- cgit v1.2.3-18-g5258