2022-07-10 17:44:39 +00:00
|
|
|
import board
|
|
|
|
import busio
|
|
|
|
import adafruit_bmp280
|
2022-07-06 16:34:46 +00:00
|
|
|
import time
|
|
|
|
|
2022-07-10 17:44:39 +00:00
|
|
|
def get_temperature():
|
2022-07-10 17:49:07 +00:00
|
|
|
i2c = busio.I2C(board.SCL, board.SDA)
|
|
|
|
bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c, address=0x76)
|
|
|
|
return bmp280.temperature
|
2022-07-09 22:24:32 +00:00
|
|
|
|
|
|
|
while True:
|
2022-07-10 17:44:39 +00:00
|
|
|
print(get_temperature())
|
2022-07-10 16:35:12 +00:00
|
|
|
time.sleep(1)
|