Commit 7c7e42f5 authored by Nocturnal42's avatar Nocturnal42

Updated the BMP085 interface to use the specified i2c bus, to make it compatable with v2 pi's

parent 9ccbda09
......@@ -67,7 +67,7 @@ def mainUpload(stdscr):
UVADC = 4
dht = DHT22.DHT22(DHTPin)
bmp = BMP085.BMP085()
bmp = BMP085.BMP085(bus=bus)
adc = MCP3008.MCP3008(SPIMOSI,SPIMISO,SPICLK,SPICS)
airSensor = AQSensor.AQSensor(adc,AQADC,pullup=22000)
lightSensor = LightSensor.LightSensor(adc,LightADC)
......
......@@ -8,9 +8,9 @@ import smbus
class Adafruit_I2C :
def __init__(self, address, bus=smbus.SMBus(0), debug=False):
def __init__(self, address, bus=0, debug=False):
self.address = address
self.bus = bus
self.bus = smbus.SMBus(bus)
self.debug = debug
def reverseByteOrder(self, data):
......
......@@ -48,8 +48,8 @@ class BMP085 :
_cal_MD = 0
# Constructor
def __init__(self, address=0x77, mode=1, debug=False):
self.i2c = Adafruit_I2C(address)
def __init__(self, address=0x77, mode=1, bus=0, debug=False):
self.i2c = Adafruit_I2C(address, bus)
self.address = address
self.debug = debug
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment