Sofia Wheelchair MPU6050

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
erodrz
Date:
Fri Jul 16 01:59:43 2021 +0000
Commit message:
MPU6050 Wheelchair

Changed in this revision

MPU6050.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 183a252cfa2a MPU6050.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MPU6050.lib	Fri Jul 16 01:59:43 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/erodrz/code/MPU6050/#659d1b0342bd
diff -r 000000000000 -r 183a252cfa2a main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jul 16 01:59:43 2021 +0000
@@ -0,0 +1,28 @@
+//include libraries in cpp file
+#include "mbed.h"
+#include "MPU6050.h"
+//creating an object of serial class so that we can communicate with PC
+Serial pc(SERIAL_TX, SERIAL_RX);
+//creating object of MPU6050 class
+MPU6050 ark(PB_9,PB_8);
+int main()
+{
+    while(1)
+    {
+        //reading Grometer readings
+        float gyro[3];
+        ark.getGyro(gyro);
+        pc.printf("Gyro X = %f\r\n",gyro[0]);
+        pc.printf("Gyro Y = %f\r\n",gyro[1]);
+        pc.printf("Gyro Z = %f\r\n",gyro[2]);
+        pc.printf("\r\n");
+        //reading Acclerometer readings
+        float acce[3];
+        ark.getAccelero(acce);
+        pc.printf("Acce X = %f\r\n",acce[0]);
+        pc.printf("Acce Y = %f\r\n",acce[1]);
+        pc.printf("Acce Z = %f\r\n",acce[2]);
+        pc.printf("\r\n");
+        wait(1); //wait 1000ms
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 183a252cfa2a mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Jul 16 01:59:43 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file