Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed YKNCT_Movement SBDBT BNO055 YKNCT_MD YKNCT_I2C
Diff: main.cpp
- Revision:
- 8:367c7d6ef5a3
- Parent:
- 7:8bea84f72e64
- Child:
- 9:94112b5df540
--- a/main.cpp Mon Mar 16 04:25:24 2020 +0000 +++ b/main.cpp Mon Mar 16 05:21:36 2020 +0000 @@ -70,10 +70,6 @@ DigitalOut CL[] = {PA_4,PA_5}; DigitalIn DO[] = {PA_6,PA_7}; -/* 壁あてリミット */ -DigitalIn limL(PA_0); -DigitalIn limR(PA_1); - /* ジャイロ用タイマー */ Timer yawCnt; @@ -83,6 +79,9 @@ /* I2C MDのクラス定義 */ YKNCT_MD_I2C MD(PB_9,PB_8); +/* I2C Inputのクラス定義 */ +YKNCT_I2C_IN In(PB_9,PB_8); + /* ジャイロのピン設定 */ BNO055 bno(PB_9, PB_8); @@ -104,6 +103,9 @@ MD.Init(1,MD_SMB); MD.Init(2,MD_SMB); MD.Init(3,MD_SMB); + + In.Init(0,0); + In.Init(0,1); telemetry.printf("\n\rMainLoopStart"); /* メインループ --------------------------------------------------------------*/ @@ -122,9 +124,6 @@ /* 自己位置推定更新 */ LocEstimate(); - /* 壁あて実行 */ - ToWall(); - /* I2CMD実行 */ MD.Exe(); @@ -159,6 +158,8 @@ if(yawCnt.read_ms()<1000) TarTheta=NowLoc.theta; /* r_val補正 */ r_val+=(TarTheta-NowLoc.theta)*CONST_CORRECTION_YAW; + + if(DS3.R1) ToWall(); omuni.XmarkOmni_Move(x_val,y_val,r_val);