import board import busio import adafruit_bmp280 import time def get_temperature(): i2c = busio.I2C(board.SCL, board.SDA) bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c, address=0x76) return bmp280.temperature while True: print(get_temperature()) time.sleep(1)