Quantcast
Channel: Support - Pimoroni Buccaneers
Viewing all articles
Browse latest Browse all 6933

Enviroplus - BME280

$
0
0

@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 the bme280 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

Read full topic


Viewing all articles
Browse latest Browse all 6933

Trending Articles