![](/media/cache/profiles/36388716_10156379864393903_5314622498057224192_n.jpg.50x50_q85.jpg)
This is a sample of library TI_MPU6050.
main.cpp
- Committer:
- tichise
- Date:
- 2018-06-04
- Revision:
- 0:b122db65cd64
File content as of revision 0:b122db65cd64:
#include "mbed.h" #include "TI_MPU6050.h" TI_MPU6050 mpu6050; DigitalOut led1(LED1); int main() { mpu6050.setSleepEnabled(false); while(1) { if (mpu6050.isHorizontal()) { led1 = 1; } else { led1 = 0; } int verticalAngle = mpu6050.getVerticalAngle(); printf("verticalAngle is %d\n\r", verticalAngle); } }