# Importe tout les modules requis
from machine import Pin, I2C
import uSGP30
import uBME280
from i2c_lcd import lcd
import time

i2c = I2C(0, scl = Pin(9), sda = Pin(8), freq = 400000)
BME_addr = 0x76;
ptr_registre = 0

bme280 = uBME280.BME280(uBME280.BME280_OSAMPLE_1, BME_addr, i2c)
display = lcd(i2c)

while True:
    t = bme280.read_temperature()/100
    p = bme280.read_pressure()/1000
    h = bme280.read_humidity()/1000
    
    print(t, "°C")
    # print(p, "hPascals")
    print(h, "%")
    display.write('Bouh')
    display.cursor(1)
    time.sleep(1)
    display.clear()