Page 1 of 1

bmp180

Posted: Tue Nov 12, 2019 2:16 pm
by bellad
hello,
i try read a bmp180 , i downloaded bmp180.py

Code: Select all

from bmp180 import BMP180
from machine import I2C, Pin                        
bus =  I2C(scl=Pin(4), sda=Pin(5), freq=100000)
with i2c.scan() = [118]
i have changed , in bmp180.py ,

Code: Select all

_bmp_addr = 119
by

Code: Select all

_bmp_addr = 118
but

Code: Select all

bmp180 = BMP180(bus)

Code: Select all

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "bmp180.py", line 22, in __init__
OSError: [Errno 19] ENODEV
I do not understand why
can you help please

Re: bmp180

Posted: Tue Nov 12, 2019 2:21 pm
by ghayne
I looks like your BMP180 is not connected properly, check the wiring.

Re: bmp180

Posted: Tue Nov 12, 2019 2:25 pm
by bellad
i think of yes , because with i2c.scan() = 118

Re: bmp180

Posted: Tue Nov 12, 2019 2:41 pm
by ghayne
I think
I2C(scl=Pin(4), sda=Pin(5), freq=100000)

should be
I2C(scl=Pin(5), sda=Pin(4), freq=100000)

Garry

Re: bmp180

Posted: Tue Nov 12, 2019 2:51 pm
by bellad
ok i put I2C(scl=Pin(5), sda=Pin(4), freq=100000)

same error

Re: bmp180

Posted: Tue Nov 12, 2019 3:02 pm
by bellad
it's ok , i download for bme280 :
it's good
thank you