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.
Fork of MPU6050_Driver_Balance by
main.cpp
- Committer:
- heroistired
- Date:
- 2018-04-09
- Revision:
- 0:badebd32bd8b
- Child:
- 1:588d4df02e56
File content as of revision 0:badebd32bd8b:
#include "mbed.h"
#include "mpu6050.h"
DigitalOut myled(LED1);
Serial pc(SERIAL_TX, SERIAL_RX);
int main() {
float pitch,roll,yaw; //欧拉角
MPU_Init(); //初始化MPU6050
myled = 0;
while(mpu_dmp_init())
{
wait(0.2);
myled = !myled;
}
while(1)
{
if(mpu_dmp_get_data(&pitch,&roll,&yaw)==0)//获取欧拉角
{
pc.printf("pitch: %.2f roll: %.2f yaw: %.2f\r\n", pitch,roll,yaw);
}
}
}
