mirror of
https://gitee.com/yyz_o/bk_bishe_pi.git
synced 2025-09-07 23:21:26 +00:00
2025.5.17第二次提交,添加根据实机调试修改的版本
This commit is contained in:
45
bot_code/maze_func_turn.cpp
Normal file
45
bot_code/maze_func_turn.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
#include<iostream>
|
||||
#include<string>
|
||||
#include"eyebot++.h"
|
||||
#include"maze_parameter.h"
|
||||
#include"maze_func.h"
|
||||
using namespace std;
|
||||
|
||||
|
||||
void BOTturn(int turn)
|
||||
{
|
||||
if (turn == 1)
|
||||
{
|
||||
MOTORDriveRaw(1,24);
|
||||
MOTORDriveRaw(2,-22);
|
||||
|
||||
OSWait(1985);
|
||||
|
||||
MOTORDriveRaw(1,0);
|
||||
MOTORDriveRaw(2,0);
|
||||
}
|
||||
else if (turn == -1)
|
||||
{
|
||||
MOTORDriveRaw(1,-24);
|
||||
MOTORDriveRaw(2,22);
|
||||
|
||||
OSWait(1985);
|
||||
|
||||
MOTORDriveRaw(1,0);
|
||||
MOTORDriveRaw(2,0);
|
||||
}
|
||||
else if (turn == 2)
|
||||
{
|
||||
MOTORDriveRaw(1,24);
|
||||
MOTORDriveRaw(2,-22);
|
||||
|
||||
OSWait(2985);
|
||||
|
||||
MOTORDriveRaw(1,0);
|
||||
MOTORDriveRaw(2,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "errer" << endl;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user