![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
pc,attachの変更
Dependencies: HCSR04_2 MPU6050_2 mbed SDFileSystem3
Fork of Autoflight2018_36 by
MPU9250/sample.txt@32:48d5d3f77c41, 2018-09-22 (annotated)
- Committer:
- taknokolat
- Date:
- Sat Sep 22 10:41:41 2018 +0000
- Revision:
- 32:48d5d3f77c41
- 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 | */ |