Expansion board
Stemi Shield has a companion expansion board with two sensors and two pumps.

Library
Stemi expansion board library exposes two classes representing the board and two sensors included on it.
expansion_board.py
class Sensor:
def __init__(board):
...
@property
def ldr(self):
...
@property
def temp(self):
...
@property
def humidity(self):
...
class ExpansionBoard:
sensor1 = Sensor()
sensor2 = Sensor()
def __init__(i2c):
...
def read():
...
Explanations
| Returns | Description | |
|---|---|---|
__init__ | an ExpansionBoard instance | creates an instance of ExpansionBoard and sets up two Sensors |
read | None | reads current sensor data and saves the values for use |
ldr | 0-1024 int | returns current value, will call read if enough time has passed since last reading |
temp | temp (°C) | returns current value, will call read if enough time has passed since last reading |
humidity | 0-1024 int | returns current value, will call read if enough time has passed since last reading |
Example
main.py
from stemi.expansion_board import ExpansionBoard
eb = ExpansionBoard(i2c)
print(eb.sensor1.temp)
print(eb.sensor1.humidity)
note
i2c is a global variable that you'll be provided with