Introduction
CircuitPython driver for the LPS28 (LPS28DFW) Pressure Sensor
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 or individual libraries can be installed using circup.
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-lps28
To install system-wide (this may be required in some cases):
sudo pip3 install adafruit-circuitpython-lps28
To install in a virtual environment in your current project:
mkdir project-name && cd project-name
python3 -m venv .venv
source .env/bin/activate
pip3 install adafruit-circuitpython-lps28
Installing to a Connected CircuitPython Device with Circup
Make sure that you have circup
installed in your Python environment.
Install it with the following command if necessary:
pip3 install circup
With circup
installed and your CircuitPython device connected use the
following command to install:
circup install adafruit_lps28
Or the following command to update an existing version:
circup update
Usage Example
import time
import board
import adafruit_lps28
i2c = board.I2C()
lps28 = adafruit_lps28.LPS28(i2c)
while True:
print(f"Temperature: {lps28.temperature}°C")
print(f"Pressure: {lps28.pressure} hPa")
Documentation
API documentation for this library can be found on Read the Docs.
For information on building library documentation, please check out this guide.
Contributing
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
Table of Contents
Examples
API Reference
- API Reference
adafruit_lps28
LPS28
LPS28.auto_ref_pressure
LPS28.auto_zero
LPS28.averaging
LPS28.data_rate
LPS28.data_ready
LPS28.data_ready_int
LPS28.data_ready_pulse
LPS28.fifo_full_int
LPS28.fifo_mode
LPS28.fifo_overrun_int
LPS28.fifo_pressure
LPS28.fifo_ready
LPS28.fifo_status
LPS28.fifo_stop_on_watermark
LPS28.fifo_unread_samples
LPS28.fifo_watermark
LPS28.fifo_watermark_int
LPS28.full_scale_mode
LPS28.int_pulldown_disable
LPS28.int_source
LPS28.interrupt_pin()
LPS28.latch_interrupt
LPS28.lpf_odr9
LPS28.pressure
LPS28.pressure_high
LPS28.pressure_low
LPS28.pressure_offset
LPS28.pressure_threshold_int
LPS28.reboot_memory()
LPS28.reference_pressure
LPS28.reset()
LPS28.reset_arp
LPS28.reset_auto_zero
LPS28.sda_pullup
LPS28.status
LPS28.temperature
LPS28.threshold_pressure
LPS28.trigger_one_shot
Related Products