from machine import Pin, I2C
import time
from bmp180 import BMP180
# I2C on GP4 (SDA) and GP5 (SCL)
i2c = I2C(0, scl=Pin(5), sda=Pin(4), freq=100000)
bmp = BMP180(i2c)
while True:
temp = bmp.temperature()
pressure = bmp.pressure() / 100 # convert Pa to hPa
print("Temperature: {:.2f} C".format(temp))
print("Pressure: {:.2f} hPa".format(pressure))
print("-------------------------")
time.sleep(1)Loading
bmp180
bmp180