フェイルセーフ完成版
Dependencies: HCSR04_2 MPU6050_2 mbed SDFileSystem3
Fork of Autoflight2018_53 by
MPU9250/sample.txt@43:4413ee61bc39, 2018-09-26 (annotated)
- Committer:
- taknokolat
- Date:
- Wed Sep 26 11:26:28 2018 +0000
- Revision:
- 43:4413ee61bc39
- Parent:
- 0:17f575135219
a;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
HARUKIDELTA | 0:17f575135219 | 1 | //This is a sample code to get pitch, roll, yaw in degree from MPU9250; |
HARUKIDELTA | 0:17f575135219 | 2 | /* |
HARUKIDELTA | 0:17f575135219 | 3 | #include "mbed.h" |
HARUKIDELTA | 0:17f575135219 | 4 | #include "MPU9250.h" |
HARUKIDELTA | 0:17f575135219 | 5 | |
HARUKIDELTA | 0:17f575135219 | 6 | Serial pc(SERIAL_TX,SERIAL_RX); |
HARUKIDELTA | 0:17f575135219 | 7 | MPU9250 mpu9250(pinSDA,pinSCL,&pc); |
HARUKIDELTA | 0:17f575135219 | 8 | |
HARUKIDELTA | 0:17f575135219 | 9 | int main(void){ |
HARUKIDELTA | 0:17f575135219 | 10 | float degrees[3]; |
HARUKIDELTA | 0:17f575135219 | 11 | |
HARUKIDELTA | 0:17f575135219 | 12 | mpu9250.Initialize(); |
HARUKIDELTA | 0:17f575135219 | 13 | |
HARUKIDELTA | 0:17f575135219 | 14 | while(1){ |
HARUKIDELTA | 0:17f575135219 | 15 | mpu9250.sensingPostureAngle(degrees); |
HARUKIDELTA | 0:17f575135219 | 16 | Serial.printf("pitch:%f, roll:%f, yaw,%f\n",degrees[0],degrees[1],degrees[2]); |
HARUKIDELTA | 0:17f575135219 | 17 | } |
HARUKIDELTA | 0:17f575135219 | 18 | } |
HARUKIDELTA | 0:17f575135219 | 19 | */ |