jy901の確認用プログラム わからなければ安澤が何とかします

Dependencies:   jy901 SerialStream 03_JY901_practice

main.cpp

Committer:
THtakahiro702286
Date:
2020-01-27
Revision:
1:fc04d6a786b0
Parent:
0:73712a48e06d
Child:
5:85564a8445f9

File content as of revision 1:fc04d6a786b0:

#include "mbed.h"
#include "jy901.h"

JY901 jy(PB_4, PA_8); //sda, scl
Serial pc(USBTX, USBRX, 115200);

int main() {
    float x, y, z;
    jy.calibrateAll(50);
    while(1) {
        x = jy.getXaxisAngle();
        y = jy.getYaxisAngle();
        z = jy.getZaxisAngle();
        pc.printf("x:%f | y:%f | z:%f\r\n", x, y, z);
    }
}