mirror of
https://gitee.com/yyz_o/bk_bishe_pi.git
synced 2025-09-07 23:21:26 +00:00
45 lines
731 B
C++
45 lines
731 B
C++
#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;
|
|
}
|
|
} |