//----------------------------------------------------------------------
//RoboEXP 4.0
传感器名称          引用库                返回类型及参数说明
1.设置马达。  #include <SetMotor.h>    SetMotor(port,state,speed)//port为端口号;state为0正转,1停止,2反转;speed为0-100.
2.红外测距。  #include <GetRange.h>    (unsigned int)变量= GetRange(port);返回距离0-500,参数port(unsigned char),范围1-254,下同。
3.触碰。      #include <GetTouch.h>    (unsigned int)变量=GetTouch(port);触碰1,反之0.
中文写代码软件4.指南针      #include <GetCompass.h>  (unsigned int)变量= GetCompass(port);返回距离0-359.
5.黑标        #include <GetBlack.h>    (unsigned char)变量=GetBlack(port),获得灰度值0-255
6.火焰        #include <GetFire.h>      (unsigned char)变量=GetFire(port),0-255,数值越大,距离火焰越近。
7.寻迹卡        #include <GetTrace.h>    (unsigned char)变量=GetTrace(port,index),返回传感器读数。index(unsigned char)-操作指令,参数范围1-8,指定返回该处灰度传感器状态。
8.复眼        #include <GetCompound.h>  (unsigned char)变量=GetCompound(port,command),根据指令参数返回读数,command(unsigned char):操作指令,范围1-12,返回特定传感器读数。
9.红外测障    #include <GetIRDete.h>  (unsigned int)变量= GetIRDete(port),如检测到障碍返回1,反之0.
10.生命探测    #include <GetLife.h>      (unsigned char)变量=GetLife(port),0-255,数值越大,距离生命越近。
11.延时        #include <delayms.h>      返回类型void,delayms(ms),参数ms毫秒(unsigned long).
12.獲取系統時間  #include <GetSysTime.h>  (unsigned int)变量= GetSysTime();返回距离0-359.
//----------------------------------------------------------------------
//RoboEXP 5.4
1.设置马达。 #include <SetMotor.h> SetMotor(port,speed)//port为端口号,格式:_M1_至_M2_(下面port同);speed为-100-100.0为停止,小于0后退,大于0前进。 例:SetMotor(_M3_, 0);
2.读取编码器。 #include <GetMotorCode.h> int var=GetMotorCode(port)读取所接端口的马达编码器数值,并存储到选定的存储变量.例:GetMotorCode(_M1_);
3.编码器清零。 #include <SetMotorCode.h> SetMotorCode(port)将所接端口的马达编码器数值设置为0,返回类型为void,例:SetMotorCode(_M1_);
4.光电检测。 #include <GetLightSensor.h>  int var=GetLightSensor(port),port取值为:_p1_至_p8_(下同),读取所接端口光电检测的数值,并存储到所选的存储变量.
5.颜检测。 #include <GetColorSensor.h>  unsigned long=GetColorSensor(port,command);port取值为:_p1_至_p8_,command(unsigned char)读取颜传感器,1-3读RGB三原值,4读取颜识别结果。识别结果与颜关系:1红,2绿,3蓝,4黄,5黑,6白,更多参加软件具体属性
6.等待时间。 #include <SetWaitForTime.h>  void=SetWaitForTime(s),等待到达设定的时间,才执行该图标后的程序。单位:秒,有效范围:0.001-10。
7.蜂鸣器控制。 #include <SetInBeep.h>  void=SetInBeep(ON/OFF);设置内置蜂鸣器开或关.