User manual
Copyright © Dr Robot Inc. 2005
33
255 255 cm or longer
24 short GetSensorIRRange ();
Description:
GetSensorIRRange returns the current distance measurement value between the infrared
range sensor and the object in front of it.
Syntax: ival = GetSensorIRRange ();
Parameter: void
Return value: short ival;
Return data interpretation when using Sharp GP2Y0A21YK:
Table III.3 Return data interpretation
Return Value Distance to Object
<=585 80 cm or longer
585 to 3446 80 to 8 cm
>=3446 0 to 8 cm
Remarks:
The relationship between the return data and the distance is not linear. Please refer to the
sensor’s datasheet for distance-voltage curve. The data returned is the raw data of the
analog to digital converter. The output voltage of the sensor can be calculated from the
following equation:
Sensor output voltage = (ival) * 3.0 / 4095 (V)
(e.g. Sharp GP2Y0A21YK
“http://sharp-world.com/products/device/lineup/data/pdf/datasheet/gp2y0a_d_e.pdf”)
III.1.3 Human Sensors
25 short GetSensorHumanAlarm1 ();
26 short GetSensorHumanAlarm2 ();
Description:
GetSensorHumanAlarm returns the current human alarm data from DHM5150 Human
Motion Sensor Module. Please refer to the Chapter IV.VIII DHM5150 (Page 106) for
detailed information.