@experiowill wrote:
Trying to follow the enviroplus tutorial but get stuck here:
Using the Python library
The Enviro+ Python library has several parts to it and, in fact, most of the parts are in separate Python libraries that you have to import on their own. The installer (
install.sh
script) should install all of these other libraries for you.Let’s go through each part of the library (libraries) in turn.
Open a terminal and type
python
to start a Python prompt.BME280 weather sensor
Let’s import some bits we need from the
smbus2
(we’ll need that to talk to the BME280) and thebme280
libraries and create an instance of the BME280 class (it contains all of the functions to read data from the sensor) first. Type:from smbus2 import SMBus from bme280 import BME280 bus = SMBus(1) bme280 = BME280(i2c_dev=bus)
Get the following error:
Traceback (most recent call last):
File “temperature-forced-mode.py”, line 8, in
from bme280 import BME280
ImportError: cannot import name BME280
Posts: 1
Participants: 1