資源簡介
機(jī)器人滅火程序 c程序
代碼片段和文件信息
#include?“studio.h“?/*頭文件定義,請勿刪除*/
#define??have?????1
#define??no???????0
#define??surf?????500
#define??surb?????500????
#define??fire?????190
#define??fire3????190
#define??fire1????90
#define??surfu????40
#define??surbu????40
int?i=0;
int?a=0;
float??fv=0.0;
float??time=0.0;
float??time1=0.0;
float??time2=0.0;
int??eye=0;
int?DI(int?i)
{
??if(AI(i)<900)??return??1;
??else???????????return??0;
}
void?run(leftright)?????????????????????????????????????????????//電機(jī)正轉(zhuǎn)
{
??SetMoto(1left*fv);
??SetMoto(0right*fv);
}
void?runb(leftright)???????????????????????????????????????????//電機(jī)反轉(zhuǎn)
{
??SetMoto(0-left*fv);
??SetMoto(1-right*fv);
}
void?stop()?????????????????????????????????????????????????//停止
{run(00);}
void?fan()??????????????????????????????
評論
共有 條評論