<gh_stars>1-10
import bme280
import smbus2
from time import sleep

# From: https://projects.raspberrypi.org/en/projects/build-your-own-weather-station/3

port = 1
address = 0x77 # Adafruit BME280 address. Other BME280s may be different
bus = smbus2.SMBus(port)

bme280.load_calibration_params(bus,address)

while True:
    bme280_data = bme280.sample(bus,address)
    humidity  = bme280_data.humidity
    pressure  = bme280_data.pressure
    ambient_temperature = bme280_data.temperature
    print(humidity, pressure, ambient_temperature)
    sleep(1)
import bme280
import smbus2
from time import sleep

# From: https://projects.raspberrypi.org/en/projects/build-your-own-weather-station/3

port = 1
address = 0x77 # Adafruit BME280 address. Other BME280s may be different
bus = smbus2.SMBus(port)

bme280.load_calibration_params(bus,address)

while True:
    bme280_data = bme280.sample(bus,address)
    humidity  = bme280_data.humidity
    pressure  = bme280_data.pressure
    ambient_temperature = bme280_data.temperature
    print(humidity, pressure, ambient_temperature)
    sleep(1)
# From: https://projects.raspberrypi.org/en/projects/build-your-own-weather-station/3 # Adafruit BME280 address. Other BME280s may be different