Hey,
I am trying to fulfil a tutorial on this site:
https://diyprojects.io/oled-display-ssd ... E-DYMZCe-m
I use an Lolin D32 Pro, the same OLED display and the newest firmware '''esp32spiram-20190125-v1.10.bin'''.
The display works. It is recognised as a I2C device (Scan i2c bus...i2c devices found: 1 60) and BME KO
is blinking all the time.
The BME280 doesn't seem to get recognised by the I2C scan...
I am using this library for the BME280:
https://github.com/loboris/MicroPython_ ... /bme280.py
There are like 5-6 other libraries and I don't know which one to use.
boot.py:
import esp
#esp.osdebug(None)
import machine
import main
machine.main("main.py")
main.py:
import machine, time, ssd1306, bme280
from ssd1306 import SSD1306, SSD1306_I2C
from bme280 import BME280
"""Display"""
pinScl = 22 #ESP8266 GPIO5 (D1)
pinSda = 21 #ESP8266 GPIO4 (D2)
addrOled = 60 #0x3c
addrBME280 = 118 #0x76
hSize = 64 # Hauteur ecran en pixels | display heigh in pixels
wSize = 128 # Largeur ecran en pixels | display width in pixels
oledIsConnected = False
bmeIsConnected = False
temp = 0
pa = 0
hum = 0
# init ic2 object
i2c = machine.I2C(scl=machine.Pin(22), sda=machine.Pin(21)) #ESP8266 5/4
library name: ssd1306.py and bme280.py.
BME280 tutorial fail library?
Re: BME280 tutorial fail library?
I just tried this library on an ESP32 with v1.10 firmware: https://github.com/robert-hh/BME280
The test code:
The Pin were chose arbitrary. The device returns proper values. The lib was ported from a Adafruit lib. I did not add a note about my own contribution, because it was minor: just changing the I2C calls and fixing a computation error (with a PR upstream).
The test code:
Code: Select all
#
# Example. Using I2C at Pin 12 and 13
#
from machine import I2C, Pin
from bme280_int import *
i2c=I2C(scl=Pin(12), sda=Pin(13), freq=1000000)
bme280 = BME280(i2c=i2c)
print(bme280.values)
Re: BME280 tutorial fail library?
Thanks sry for the delay.
Everything is working
Everything is working