EtherMania.com.WeatherShield1.readRawValue C# (CSharp) Method

readRawValue() public method

public readRawValue ( units unitType, sample sampleNum ) : short
unitType units
sampleNum sample
return short
        public short readRawValue(units unitType, sample sampleNum)
        {
            short result = short.MinValue;
            commands command = commands.CMD_UNKNOWN;

            switch (unitType)
            {
                case units.TEMPERATURE:
                    command = commands.CMD_GETTEMP_C_RAW;
                    break;

                case units.HUMIDITY:
                    command = commands.CMD_GETHUM_RAW;
                    break;

                case units.PRESSURE:
                    command = commands.CMD_GETPRESS_RAW;
                    break;
            }

            sendCommand(command, (Byte) sampleNum);
            if (readAnswer(command))
                result = decodeShortValue();

            return result;
        }