From 6ada7eb46a37811948f3c24209b2ceb425ccf688 Mon Sep 17 00:00:00 2001 From: Gabri6 Date: Mon, 24 Apr 2023 12:49:37 +0200 Subject: [PATCH] gyro sensor implementation --- gyro/gyro.ino | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 gyro/gyro.ino diff --git a/gyro/gyro.ino b/gyro/gyro.ino new file mode 100644 index 0000000..75092a2 --- /dev/null +++ b/gyro/gyro.ino @@ -0,0 +1,30 @@ +#include +#include + + +MeGyro gyro(4); + + +float distance; +float lSpeed; +float rSpeed; +float duration; +int Side; +double angleZ; +double gyroX; + +void setup() { + // put your setup code here, to run once: + Serial.begin(9600); + gyro.begin(); + +} + +void loop() { + // put your main code here, to run repeatedly: + + gyro.update(); + angleZ = gyro.getAngleZ(); + Serial.println(gyro.getAngleZ())); + +} \ No newline at end of file