OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
hardware_io.environmental.bmp3xx.Bmp3xx Class Reference

Read pressure and sensor temperature from a BMP388 or BMP390 over I2C. More...

Inheritance diagram for hardware_io.environmental.bmp3xx.Bmp3xx:
hardware_io.environmental.barometric_sensor_if.BarometricSensorIf hardware_io.environmental.bmp388.Bmp388 hardware_io.environmental.bmp390.Bmp390

Public Member Functions

None __init__ (self, int address=DEFAULT_ADDRESS, Any|None i2c=None)
 Create a BMP3XX sensor.
 
bool is_started (self)
 Return whether the sensor has been initialized.
 
int address (self)
 Return the configured I2C address.
 
None start (self)
 Initialize the I2C bus and BMP3XX sensor.
 
None stop (self)
 Release resources owned by the sensor.
 
float get_pressure_pa (self)
 Return atmospheric pressure in pascals.
 
float get_temperature_c (self)
 Return sensor temperature in degrees Celsius.
 

Detailed Description

Read pressure and sensor temperature from a BMP388 or BMP390 over I2C.

Adafruit's BMP3XX driver detects and supports both sensor variants. The underlying driver reports pressure in hectopascals; this implementation converts it to pascals before exposing it through the hardware interface.

Constructor & Destructor Documentation

◆ __init__()

None hardware_io.environmental.bmp3xx.Bmp3xx.__init__ (   self,
int   address = DEFAULT_ADDRESS,
Any | None   i2c = None 
)

Create a BMP3XX sensor.

Args: address: I2C address of the sensor. i2c: Optional pre-created CircuitPython-compatible I2C bus. When omitted, the Raspberry Pi's default I2C bus is used.


The documentation for this class was generated from the following file: