jy901の確認用プログラム わからなければ安澤が何とかします
Dependencies: jy901 SerialStream 03_JY901_practice
Diff: main.cpp
- Revision:
- 0:73712a48e06d
- Child:
- 1:fc04d6a786b0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Oct 25 09:36:43 2019 +0000 @@ -0,0 +1,16 @@ +#include "mbed.h" +#include "jy901.h" + +JY901 jy(D5, D7); //sda, scl +Serial pc(USBTX, USBRX); + +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); + } +} \ No newline at end of file