|
// sensor configuration
SetSensorColorFull(_port)
SetSensorColorRed(_port)
SetSensorColorGreen(_port)
SetSensorColorBlue(_port)
SetSensorColorNone(_port)
// API functions for reading sensor information
ReadSensorColorRaw(_port, _rawVals)
ReadSensorColorEx(_port, _colorval, _raw, _norm, _scaled)
// low level access to Input IOMap color sensor structure data
// _p = port
// _np = point number
// _nc = color number
ColorCalibration(_p, _np, _nc)
ColorCalLimits(_p, _np)
ColorADRaw(_p, _nc)
ColorSensorRaw(_p, _nc)
ColorSensorValue(_p, _nc)
ColorBoolean(_p, _nc)
ColorCalibrationState(_p)
// structure for low level API function (below)
struct ColorSensorReadType {
char Result;
byte Port;
int ColorValue;
unsigned int RawArray[];
unsigned int NormalizedArray[];
int ScaledArray[];
bool Invalid;
};
SysColorSensorRead(_args)
// constants related to Colorstruct
#define INPUT_RED 0
#define INPUT_GREEN 1
#define INPUT_BLUE 2
#define INPUT_BLANK 3
#define INPUT_NO_OF_COLORS 4
// color sensor value when used as color detector
#define INPUT_BLACKCOLOR 1
#define INPUT_BLUECOLOR 2
#define INPUT_GREENCOLOR 3
#define INPUT_YELLOWCOLOR 4
#define INPUT_REDCOLOR 5
#define INPUT_WHITECOLOR 6
// color calibration state
#define INPUT_SENSORCAL 0x01
#define INPUT_SENSOROFF 0x02
#define INPUT_RUNNINGCAL 0x20
#define INPUT_STARTCAL 0x40
#define INPUT_RESETCAL 0x80
#define INPUT_CAL_POINT_0 0
#define INPUT_CAL_POINT_1 1
#define INPUT_CAL_POINT_2 2
#define INPUT_NO_OF_POINTS 3 |
评分
-
查看全部评分
|