Example #1
0
 static void MeasurementComplete(object sender, BMP180.SensorData sensorData)
 {
     Debug.Print("Temperature - " + sensorData.Temperature.ToString("f2") + (_bmp180.TemperatureUnit == TemperatureUnits.Celsius ? "°C" : _bmp180.TemperatureUnit == TemperatureUnits.Fahrenheit ? " °F" : "°K"));
     Debug.Print("Pressure (Sea Level Compensated) - " + Pressure.ToInchesHg(sensorData.CompensatedPressure).ToString("f2") + " in Hg");
     Debug.Print("Pressure (Sea Level Compensated) - " + Pressure.ToHectoPascals(sensorData.CompensatedPressure).ToString("f1") + " hPa");
     Debug.Print("Pressure (Raw) - " + Pressure.ToInchesHg(sensorData.RawPressure).ToString("f2") + " in Hg");
     Debug.Print("Pressure (Raw) - " + Pressure.ToHectoPascals(sensorData.RawPressure).ToString("f1") + " hPa");
     Debug.Print("Altitude - " + Altitude.ToFeet(sensorData.Altitude).ToString("f0") + " feet");
     Debug.Print("Altitude - " + sensorData.Altitude.ToString("f0") + " meters");
     Debug.Print("SensorData ToString method - " + sensorData + "\n");
 }
Example #2
0
        private static void DirectReadThread()
        {
            Debug.Print("____________Sensor Data using direct read methods____________");

            while (true)
            {
                Debug.Print("Temperature - " + _bmp180.ReadTemperature().ToString("f2") + (_bmp180.TemperatureUnit == TemperatureUnits.Celsius ? "°C" : _bmp180.TemperatureUnit == TemperatureUnits.Fahrenheit ? " °F" : "°K"));
                Debug.Print("Temperature RawData - " + (_bmp180 as ITemperature).RawData);
                Debug.Print("SLC Compensated Pressure - " + Pressure.ToInchesHg(_bmp180.ReadPressure()).ToString("f1") + " in Hg");
                Debug.Print("Uncompensated Pressure - " + Pressure.ToInchesHg(_bmp180.ReadPressure(PressureCompensationModes.Uncompensated)).ToString("f1") + " in Hg");
                Debug.Print("Pressure RawData - " + (_bmp180 as IPressure).RawData);
                Debug.Print("Altitude - " + Altitude.ToFeet(_bmp180.ReadAltitude()) + " feet");
                Debug.Print("\n");
                Thread.Sleep(5000);
            }
        }