![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
holA
Dependencies: MPU6050
Diff: main.cpp
- Revision:
- 0:a8e1f3eae858
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Oct 30 20:25:58 2020 +0000 @@ -0,0 +1,29 @@ +#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); +//setting LED1 to give digital output +DigitalOut myled(LED1); +//creating onject of MPU6050 class +MPU6050 ark(D14,D15); +int main(){ + pc.printf("Holas prros"); + while(1) { + //reading Temprature + //float temp = ark.getTemp(); + //pc.printf("temprature = %0.2f ^C\r\n",temp); + + //reading Grometer readings + float gyro[3]; + ark.getGyro(gyro); + pc.printf("Gyro0=%f,\tGyro1=%f,\tGyro2=%f\r\n",gyro[0],gyro[1],gyro[2]); + + //reading Acclerometer readings + //float acce[3]; + //ark.getAccelero(acce); + //pc.printf("Acce0=%f,Acce1=%f,Acce2=%f\r\n",acce[0],acce[1],acce[2]); + myled=!myled; + thread_sleep_for(500); //wait 1000ms + } +} \ No newline at end of file