public GetSensorValue ( Sensor sensor, short &value ) : bool | ||
sensor | Sensor | Sensor to get value of. |
value | short | Retrieved sensor's value (units depend on current
/// |
return | bool |
public bool GetSensorValue( Sensor sensor, out short value )
{
byte[] reply = new byte[3];
if ( SendCommand( new byte[] { (byte) RCXCommand.GetValue, 9, (byte) sensor }, reply, 3 ) )
{
value = (short) ( reply[1] | ( reply[2] << 8 ) );
return true;
}
value = 0;
return false;
}