jy901の確認用プログラム わからなければ安澤が何とかします
Dependencies: jy901 SerialStream 03_JY901_practice
Diff: main.cpp
- Revision:
- 5:85564a8445f9
- Parent:
- 1:fc04d6a786b0
diff -r 3acbcab5085b -r 85564a8445f9 main.cpp --- a/main.cpp Fri Jan 08 10:19:48 2021 +0000 +++ b/main.cpp Sat Jan 30 10:50:42 2021 +0000 @@ -1,16 +1,17 @@ #include "mbed.h" #include "jy901.h" -JY901 jy(PB_4, PA_8); //sda, scl -Serial pc(USBTX, USBRX, 115200); +JY901 jy(D14, D15); //sda, scl +BufferedSerial pc(USBTX, USBRX, 115200); int main() { - float x, y, z; + double 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); +// printf("x: %f | y: %f | z: %f test: %f \r\n", x, y, z); + printf("test %f\r\n", 100.0023); } } \ No newline at end of file