summaryrefslogtreecommitdiff
path: root/gyro.ino
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-11-23 09:24:48 +0100
committerHampusM <hampus@hampusmat.com>2021-11-23 09:24:48 +0100
commitc4d200330b71276abee2d2c18906991e0f4e5c13 (patch)
tree60872d2b703a266aa7eea64552d850c2dbfda5f0 /gyro.ino
parent8cf0b19088eb832d3555137da388068adf205626 (diff)
add core files
Diffstat (limited to 'gyro.ino')
-rw-r--r--gyro.ino28
1 files changed, 28 insertions, 0 deletions
diff --git a/gyro.ino b/gyro.ino
new file mode 100644
index 0000000..9037799
--- /dev/null
+++ b/gyro.ino
@@ -0,0 +1,28 @@
+#include "gyroscope.hpp"
+
+void setup()
+{
+ Serial.begin(9600);
+
+ Serial.println("Hej!");
+
+ auto gyroscope_id = Gyroscope::initialize();
+
+ if (gyroscope_id == -1)
+ {
+ Serial.println("Failed to communicate with gyrosensor!");
+ exit(1);
+ }
+
+ Gyroscope gyroscope(gyroscope_id);
+}
+
+void loop()
+{
+ //auto gyroscope_data = read();
+
+ //char *out;
+ //sprintf(out, "X: %d Y: %d Z: %d", gyroscope_data.x, gyroscope_data.y, gyroscope_data.z);
+
+ // Serial.println("hej!");
+} \ No newline at end of file