change code by hasegawa
Diff: jy901.cpp
- Revision:
- 3:ba9da7dbbd9a
- Parent:
- 0:f80d034ed481
--- a/jy901.cpp Wed Aug 23 06:14:28 2017 +0000 +++ b/jy901.cpp Tue Sep 29 13:25:52 2020 +0000 @@ -27,6 +27,18 @@ char calibrationRegistar[3]= {CALSW,0x00,0x00}; write(IICADDR,calibrationRegistar,3,false); } +//ここより下は長谷川が追加しました。不必要な場合は教えてください。2020/09/29 +void JY901::yawcalibrate() +{ + char calibrationRegistar[3]= {0x01,0x04,0x00}; + write(IICADDR,calibrationRegistar,3,false); +} + +void JY901::algorithmtrasition() +{ + char calibrationRegistar[3]= {0x24,0x01,0x00}; + write(IICADDR,calibrationRegistar,3,false); +} void JY901::calibrateAll(int time) { @@ -37,6 +49,11 @@ calibrateHeight(); wait_ms(time); endCalibrate(); + wait_ms(time); + algorithmtrasition(); + wait_ms(time); + yawcalibrate(); + } float JY901::getXaxisAcceleration() @@ -120,3 +137,4 @@ read(IICADDR,data,2,false); return data; } +