/// <summary> /// Try and get new readings. /// </summary> /// <param name="readings">Optionally filled out readings.Pressure</param> public override void GetReadings(ref SensorReadings readings) { var status = Read8(C_Status); if ((status & 2) == 2) { var raw = (Int32)Read24LE(C_PressOutXL + 0x80); readings.Pressure = raw * pressureFactor; } }
/// <summary> /// Try and get new readings, may fail in which case readings.X will be null /// </summary> /// <param name="readings">Optionally filled in readings.Temperature and readings.Humidity</param> public override void GetReadings(ref SensorReadings readings) { var status = Read8(C_Status); if ((status & 1) == 1) { var raw = (Int16)Read16LE(C_TempOutL + 0x80); readings.Temperature = convertTemperature(raw); } if ((status & 2) == 2) { var raw = (Int16)Read16LE(C_HumidityOutL + 0x80); readings.Humidity = convertHumidity(raw);; } }
public abstract void GetReadings(ref SensorReadings readings);
public override void GetReadings(ref SensorReadings readings) { throw new NotImplementedException(); }