aaa
Dependencies: HCSR04_2 MPU6050_2 mbed SDFileSystem3
MPU9250/sample.txt@1:f31e17341659, 2018-08-28 (annotated)
- Committer:
- TUATBM
- Date:
- Tue Aug 28 07:12:16 2018 +0000
- Revision:
- 1:f31e17341659
- Parent:
- 0:92024886c0be
aaa
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
TUATBM | 0:92024886c0be | 1 | //This is a sample code to get pitch, roll, yaw in degree from MPU9250; |
TUATBM | 0:92024886c0be | 2 | /* |
TUATBM | 0:92024886c0be | 3 | #include "mbed.h" |
TUATBM | 0:92024886c0be | 4 | #include "MPU9250.h" |
TUATBM | 0:92024886c0be | 5 | |
TUATBM | 0:92024886c0be | 6 | Serial pc(SERIAL_TX,SERIAL_RX); |
TUATBM | 0:92024886c0be | 7 | MPU9250 mpu9250(pinSDA,pinSCL,&pc); |
TUATBM | 0:92024886c0be | 8 | |
TUATBM | 0:92024886c0be | 9 | int main(void){ |
TUATBM | 0:92024886c0be | 10 | float degrees[3]; |
TUATBM | 0:92024886c0be | 11 | |
TUATBM | 0:92024886c0be | 12 | mpu9250.Initialize(); |
TUATBM | 0:92024886c0be | 13 | |
TUATBM | 0:92024886c0be | 14 | while(1){ |
TUATBM | 0:92024886c0be | 15 | mpu9250.sensingPostureAngle(degrees); |
TUATBM | 0:92024886c0be | 16 | Serial.printf("pitch:%f, roll:%f, yaw,%f\n",degrees[0],degrees[1],degrees[2]); |
TUATBM | 0:92024886c0be | 17 | } |
TUATBM | 0:92024886c0be | 18 | } |
TUATBM | 0:92024886c0be | 19 | */ |