Dependencies¶
This driver depends on:
Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.
Installing from PyPI¶
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:
pip3 install adafruit-circuitpython-mpl115a2
To install system-wide (this may be required in some cases):
sudo pip3 install adafruit-circuitpython-mpl115a2
To install in a virtual environment in your current project:
mkdir project-name && cd project-name
python3 -m venv .env
source .env/bin/activate
pip3 install adafruit-circuitpython-mpl115a2
Usage Example¶
See usage examples in the examples folder.
Contributing¶
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
Documentation¶
For information on building library documentation, please check out this guide.
Table of Contents¶
Simple test¶
Ensure your device works with this simple test.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
import time
import board
import busio
import adafruit_mpl115a2
i2c = busio.I2C(board.SCL, board.SDA)
mpl = adafruit_mpl115a2.MPL115A2(i2c)
while True:
print("Pressure: {} Temperature: {}".format(mpl.pressure, mpl.temperature))
time.sleep(1)
|
adafruit_mpl115a2
¶
CircuitPython driver for MPL115A2 I2C Barometric Pressure/Temperature Sensor.
- Author(s): Carter Nelson
Implementation Notes¶
Hardware:
Software and Dependencies:
- Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
- Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice