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.
main.cpp
- Committer:
- saeichi
- Date:
- 2020-05-30
- Revision:
- 3:6e7e6c7dd747
- Parent:
- 2:fc47fabf9268
File content as of revision 3:6e7e6c7dd747:
#include "mbed.h"
#include "MPU6050.h"
DigitalOut myled(LED1);
MPU6050 mpu(D4, D5);
int main() {
    while(1){
        int gyro[3];
        mpu.readGyroData(gyro); //gyro[3]に代入
        printf("x:%d y:%d z:%d\r\n",gyro[0],gyro[1],gyro[2]);
        wait(0.1);
    }
    
    /* おまけ 加速度
    while(1){
        int accel[3];
        mpu.readAccelData(acc);
        printf("x:%d y:%d z:%d\r\n",accel[0],accel[1],accel[2]);
    }
    */
    
}