User manual
Copyright © Dr Robot Inc. 2006 
33
packets to PC central controller */ 
Return value:  void 
Remarks: 
The default PeriodTime = 50 (ms), i.e. update rate is 20Hz. PeriodTime should be bigger 
than 50 (ms), i.e. the system data fastest refresh rate is 20Hz. 
See Also: SystemMotorSensorRequest, SystemStandardSensorRequest, 
SystemCustomSensorRequest, SystemAllSensorRequest. 
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: 
Table III.2 Meanings of PacketNumber 
Return Value  Distance to Object 
4  0 to 4 cm 
4 to 254  4 to 254 cm 










