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:
- beingblock
- Date:
- 2016-05-24
- Revision:
- 0:5ac6fdeb615e
- Child:
- 2:fc47fabf9268
File content as of revision 0:5ac6fdeb615e:
#include "mbed.h"
#include "MPU6050.h"
DigitalOut myled(LED1);
MPU6050 mpu(PB_9,PB_8);
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]);
    }
    */
    
}