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.
MPU9250/sample.txt@0:eae101ae93c0, 2019-02-06 (annotated)
- Committer:
- taknokolat
- Date:
- Wed Feb 06 10:54:28 2019 +0000
- Revision:
- 0:eae101ae93c0
a;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| taknokolat | 0:eae101ae93c0 | 1 | //This is a sample code to get pitch, roll, yaw in degree from MPU9250; |
| taknokolat | 0:eae101ae93c0 | 2 | /* |
| taknokolat | 0:eae101ae93c0 | 3 | #include "mbed.h" |
| taknokolat | 0:eae101ae93c0 | 4 | #include "MPU9250.h" |
| taknokolat | 0:eae101ae93c0 | 5 | |
| taknokolat | 0:eae101ae93c0 | 6 | Serial pc(SERIAL_TX,SERIAL_RX); |
| taknokolat | 0:eae101ae93c0 | 7 | MPU9250 mpu9250(pinSDA,pinSCL,&pc); |
| taknokolat | 0:eae101ae93c0 | 8 | |
| taknokolat | 0:eae101ae93c0 | 9 | int main(void){ |
| taknokolat | 0:eae101ae93c0 | 10 | float degrees[3]; |
| taknokolat | 0:eae101ae93c0 | 11 | |
| taknokolat | 0:eae101ae93c0 | 12 | mpu9250.Initialize(); |
| taknokolat | 0:eae101ae93c0 | 13 | |
| taknokolat | 0:eae101ae93c0 | 14 | while(1){ |
| taknokolat | 0:eae101ae93c0 | 15 | mpu9250.sensingPostureAngle(degrees); |
| taknokolat | 0:eae101ae93c0 | 16 | Serial.printf("pitch:%f, roll:%f, yaw,%f\n",degrees[0],degrees[1],degrees[2]); |
| taknokolat | 0:eae101ae93c0 | 17 | } |
| taknokolat | 0:eae101ae93c0 | 18 | } |
| taknokolat | 0:eae101ae93c0 | 19 | */ |