Files
bk_bishe_pi/robot_test_code/实机测试/test_psd.cpp

23 lines
505 B
C++

#include<iostream>
#include<string>
#include"eyebot++.h"
using namespace std;
int main()
{
int Fwall,Lwall,Rwall,bwall;
LCDMenu("","","","END");
do
{
Fwall = PSDGetRaw(1)-2; //检测前面侧是否有墙
Lwall = PSDGetRaw(2)-16; //检测左面
Rwall = PSDGetRaw(3); //检测右面
bwall = PSDGetRaw(4); //
cout << "PSD L:" << Lwall << " R:" << Rwall << " F:" << Fwall << " b:" << bwall << endl; ;
} while (KEYRead() != KEY4);
}