Subversion Repositories yaws

Rev

Rev 9 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9 Rev 15
Line 21... Line 21...
21
#  MA 02110-1301, USA.
21
#  MA 02110-1301, USA.
22
#  
22
#  
23
#  
23
#  
24
import smbus2
24
import smbus2
25
import bme280
25
import bme280
-
 
26
from sensors import i2cbus, bme280_address
Line 26... Line 27...
26
 
27
 
27
bus = smbus2.SMBus(i2cbus)
-
 
28
 
28
def __init__():
-
 
29
    if bme280_address is not None:
29
if bme280_address is not None:
30
        bus = smbus2.SMBus(i2cbus)
30
    calibration_params = bme280.load_calibration_params(bus, bme280_address)
-
 
31
 
31
        calibration_params = bme280.load_calibration_params(bus, bme280_address)
Line 32... Line 32...
32
data = bme280.sample(bus, bme280_address, calibration_params)
32
        data = bme280.sample(bus, bme280_address, calibration_params)
33
 
33
 
34
def read_tph():
34
def read_tph():
35
    if bme280_address is not None:
35
    if bme280_address is not None: