jy901の確認用プログラム わからなければ安澤が何とかします
Dependencies: jy901 SerialStream 03_JY901_practice
main.cpp@5:85564a8445f9, 2021-01-30 (annotated)
- Committer:
- piroro4560
- Date:
- Sat Jan 30 10:50:42 2021 +0000
- Revision:
- 5:85564a8445f9
- Parent:
- 1:fc04d6a786b0
1/30/2021
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
piroro4560 | 0:73712a48e06d | 1 | #include "mbed.h" |
piroro4560 | 0:73712a48e06d | 2 | #include "jy901.h" |
piroro4560 | 0:73712a48e06d | 3 | |
piroro4560 | 5:85564a8445f9 | 4 | JY901 jy(D14, D15); //sda, scl |
piroro4560 | 5:85564a8445f9 | 5 | BufferedSerial pc(USBTX, USBRX, 115200); |
piroro4560 | 0:73712a48e06d | 6 | |
piroro4560 | 0:73712a48e06d | 7 | int main() { |
piroro4560 | 5:85564a8445f9 | 8 | double x, y, z; |
piroro4560 | 0:73712a48e06d | 9 | jy.calibrateAll(50); |
piroro4560 | 0:73712a48e06d | 10 | while(1) { |
piroro4560 | 0:73712a48e06d | 11 | x = jy.getXaxisAngle(); |
piroro4560 | 0:73712a48e06d | 12 | y = jy.getYaxisAngle(); |
piroro4560 | 0:73712a48e06d | 13 | z = jy.getZaxisAngle(); |
piroro4560 | 5:85564a8445f9 | 14 | // printf("x: %f | y: %f | z: %f test: %f \r\n", x, y, z); |
piroro4560 | 5:85564a8445f9 | 15 | printf("test %f\r\n", 100.0023); |
piroro4560 | 0:73712a48e06d | 16 | } |
piroro4560 | 0:73712a48e06d | 17 | } |