Commit e5925910 authored by Andreas Motl's avatar Andreas Motl
Browse files

Naming things

parent 3a48d423
No related merge requests found
Pipeline #12 failed with stages
Showing with 26 additions and 11 deletions
+26 -11
# Source: Probably derived from https://bitbucket.org/oscarBravo/wipy_bme280
#
# Author: Butch Anton 2017
# Based on the work by #Author: Paul Cunnane 2016
......
# Source: Probably derived from https://github.com/catdog2/mpy_bme280_esp8266/blob/master/bme280.py
#
# Authors: Paul Cunnane 2016, Peter Dahlebrg 2016
#
# This module borrows from the Adafruit BME280 Python library. Original
......
from machine import I2C
# configure the I2C bus
i2c = I2C(0, I2C.MASTER, baudrate=100000)
print(i2c.scan())
print(i2c.readfrom(0x76, 5))
#from machine import I2C
from bme280 import *
i2c = I2C()
bme280 = BME280(address=0x76, i2c=i2c)
print(bme280.values)
def read_bme(adapter):
# Configure the I2C bus
from machine import I2C
i2c = I2C(0, I2C.MASTER, baudrate=100000)
print(i2c.scan())
#print(i2c.readfrom(0x76, 5))
# Read sensor
bme280 = adapter(address=0x76, i2c=i2c)
print(bme280.values)
if __name__ == '__main__':
# ESP8266 adapter
#from bme280_esp8266 import BME280
# ESP32 adapter
from bme280_esp32 import BME280
# Read sensor with specified adapter
read_bme(BME280)
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