mirror of
https://gitee.com/yyz_o/bk_bishe_pi.git
synced 2025-09-07 23:21:26 +00:00
2025.5.15第二次提交,按照实际场景初步修改代码。
This commit is contained in:
@@ -5,8 +5,11 @@ using namespace std;
|
||||
|
||||
|
||||
/*---定义全局常量---*/
|
||||
const int DIST_cell = 300 ;
|
||||
const int DIST_wall = 100 ;
|
||||
// const int DIST_cell = 300 ;
|
||||
// const int DIST_wall = 100 ;
|
||||
const int DIST_cell = 300;
|
||||
const int DIST_wall_f = 68;
|
||||
// const int DIST_wall_rl = 88;
|
||||
/*---全局各种变量与常量定义完成---*/
|
||||
|
||||
|
||||
@@ -25,7 +28,7 @@ int main()
|
||||
//判断旋转方向
|
||||
if (Lwall)
|
||||
{
|
||||
VWTurn(+90,45); //向左旋转
|
||||
VWTurn(+90,10); //向左旋转
|
||||
VWWait();
|
||||
}
|
||||
else if (Fwall)
|
||||
@@ -34,12 +37,12 @@ int main()
|
||||
}
|
||||
else if (Rwall)
|
||||
{
|
||||
VWTurn(-90,45); //向右旋转
|
||||
VWTurn(-90,10); //向右旋转
|
||||
VWWait();
|
||||
}
|
||||
else
|
||||
{
|
||||
VWTurn(180,45);
|
||||
VWTurn(180,10);
|
||||
VWWait();
|
||||
}
|
||||
//直走
|
||||
|
||||
Reference in New Issue
Block a user