Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:183a252cfa2a, committed 2021-07-16
- Comitter:
- erodrz
- Date:
- Fri Jul 16 01:59:43 2021 +0000
- Commit message:
- MPU6050 Wheelchair
Changed in this revision
--- /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
--- /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
--- /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