mirror of
https://github.com/sascha-hemi/pycom-documentation.git
synced 2026-03-21 07:06:20 +01:00
* restructuring Pycoproc documentation * Fixed formatting * added to menu tree * removed the pytrack / pysense layer * Completed the Pycoproc API * fixed naming * updated landing page * renamed to shields * added v16 warning * restructuring Pycoproc documentation * Fixed formatting * added to menu tree * removed the pytrack / pysense layer * Completed the Pycoproc API * fixed naming * updated landing page * renamed to shields * added v16 warning * added sensor list and changed naming * modified links * changed menu names * updated naming
726 B
726 B
Title
| Title |
|---|
| Pressure and Altitude sensor |
Constructors
class MPL3115A2(pycoproc = None, sda = 'P22', scl = 'P21', mode = MPL3115A2.PRESSURE)
Creates a MPL3115A2 object. Constructor must be passed a Pycoproc or I2C object to successfully construct.
Methods
MPL3115A2.pressure()
Read the atmospheric pressure of the sensor. Returns a float with the pressure in Pascal.
MPL3115A2.altitude()
Read the altitude of the sensor. Returns a float with the altitude in meter.
MPL3115A2.temperature()
Read the temperature of the sensor. Returns a float with the temperature in degrees Celcius.
Constants
The following constants may be passed into the constructor.
- mode:
PRESSURE,ALTITUDE