robert-hh / BME280

Micropython driver for the BME280 sensor, target platform Pycom devices
Other
104 stars 27 forks source link

OSError: I2C bus error #1

Closed GeirFrimann closed 5 years ago

GeirFrimann commented 5 years ago

I'm trying this library on Pycom gpy and fipy and Adafruit breakout board (https://www.adafruit.com/product/2652), but gets error OSError: I2C bus error:

`from machine import I2C import bme280_int i2c = I2C(0,mode=I2C.MASTER,pins=('P9','P10'),baudrate=1000000) print(i2c.scan())

REPL [119]

bme = bme280_int.BME280(i2c=i2c)

REPL File "/flash/lib/bme280_int.py", line 88, in init

OSError: I2C bus error` Same issue with bme280_float.py, but on line 84.

robert-hh commented 5 years ago

The result of i2c.scan tells, that the address of your bme280 module is 119. The default in the driver is 118. So you have to specify the address in instantiating the driver bme = bme280_int.BME280(i2c=i2c, address=119)

GeirFrimann commented 5 years ago

Ahh, tanks, now it works!