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:
- 9:94112b5df540
- Parent:
- 8:367c7d6ef5a3
- Child:
- 10:9ee22b22e583
--- a/main.cpp Mon Mar 16 05:21:36 2020 +0000 +++ b/main.cpp Mon Mar 16 05:39:32 2020 +0000 @@ -158,11 +158,12 @@ 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); + /* 壁あて実行 */ + if(DS3.R1) ToWall(); + for(int i=0; i<4; i++) MD.Set(i,MovMotor[i]); } @@ -289,10 +290,10 @@ *******************************************************************************/ void ToWall(void) { - if(limL==0) + if(In.Get(0)==0) for(int i=0; i<2; i++) MovMotor[i]-=10; else for(int i=0; i<2; i++) MovMotor[i]+=0; - if(limR==0) + if(In.Get(1)==0) for(int i=2; i<4; i++) MovMotor[i]+=10; else for(int i=2; i<4; i++) MovMotor[i]+=0; } \ No newline at end of file