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

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
| Returns | Description | |
|---|---|---|
__init__ | a Barometer instance | creates an instance of the barometer class and sets it up |
read | pressure (hPa), temp (°C) | reads current sensor data and returns both pressure and temperature |
pressure | pressure (hPa) | reads current sensor data and returns pressure |
temp | temp (°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