Skip to main content

Barometer

Stemi shield has an included barometer that can measure pressure and temperature.

Barometer

Library

Stemi barometer library exposes one class representing the included sensor (SPL06-001) on the board.

barometer.py
class Barometer:
def __init__(i2c):
...

def read():
...

@property
def pressure():
...

@property
def temp():
...

Explanations

ReturnsDescription
__init__a Barometer instancecreates an instance of the barometer class and sets it up
readpressure (hPa), temp (°C)reads current sensor data and returns both pressure and temperature
pressurepressure (hPa)reads current sensor data and returns pressure
temptemp (°C)reads current sensor data and returns temperature

Example

main.py
from stemi.barometer import Barometer

b = Barometer(i2c)

print(b.pressure)
note

i2c is a global variable that you'll be provided with