Manual
Copyright © Dr Robot Inc. 2008
9
III.1.2. Range and Distance Sensors
17 short GetSensorSonar1 ();
18 short GetSensorSonar2 ();
19 short GetSensorSonar3 ();
20 short GetSensorSonar4 ();
21 short GetSensorSonar5 ();
22 short GetSensorSonar6 ();
23 short GetSensorSonar (short channel);
Description:
GetSonarSensorX returns the current distance value between the relevant ultrasonic
range sensor module (DUR5200) and the object in front of it. The unit is cm.
Syntax: ival = GetSensorSonar1 (); // Sonar #1
ival = GetSensorSonar2 (); // Sonar #2
ival = GetSensorSonar3 (); // Sonar #3
ival = GetSensorSonar4 (); // Sonar #4
ival = GetSensorSonar5 (); // Sonar #5
ival = GetSensorSonar6 (); // Sonar #6
ival = GetSensorSonar (short channel); // Sonar #1, 2, 3, 4, 5, or 6
Parameter: void
short channel; // 0, 1, 2, 3, 4, or 5 for Sonar #1, 2, 3, 4, 5, 6
Return value: short ival;
Return data interpretation:
Return Value Distance to Object
4 0 to 4 cm
4 to 254 4 to 254 cm
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:










