Firmware & API Reference
>
Pycom Modules
>
Shields
>
MPL3115A2
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