An Adafruit BME280 (Pressure, Temp & Humidity) Sensor library for Windows IoT Core
var bme280Sensor = new BME280Sensor();
// Initialize BME280 Sensor
await bme280Sensor.Initialize();
// Read Temperature
var temp = bme280Sensor.ReadTemperature();
// Read Humidity
var humidity = bme280Sensor.ReadHumidity();
// Read Barometric Pressure
var pressure = bme280Sensor.ReadPressure();
// Read Altitude
const float seaLevelBarometricPressure = 1022.00f;
var altitude = bmd280Sensor.ReadAltitude(seaLevelBarometricPressure);
Here's a simple Fritzing diagram that shows the expected wiring of the Adafruit BME280 sensor with a Raspberry Pi 2 or 3:
The Weather Station V 3.0 project on Hackster.io provides a simple tutorial on using this library in a new UWP app. Also, the full source code for that project is available at the following location:
https://github.com/BuildAzure/AdafruitBME280WeatherStation
This code was originally posted as part of the Weather Station V 2.0 project on hackster.io. Since that project wasn't released using any reusable Nuget libraries for working with the Adafruit BME280 sensor, this project was created to borrow the BME280 code and release that out as a Nuget package for others to consume. Thankfully it's all licensed under the MIT License, and so is this project!