Pysense API
This chapter describes the various libraries which are designed for the Pysense Board. This includes details about the various methods and classes available for each of the Pysense’s sensors.
3-Axis Accelerometer (LIS2HH12)
Pysense has a 3-Axis Accelerometer that provides outputs for acceleration as well as roll, pitch and yaw.
Constructors
Creates a LIS2HH12 object, that will return values for acceleration, roll, pitch and yaw. Constructor must be passed a Pysense or I2C object to successfully construct.
Methods
Read the acceleration from the LIS2HH12. Returns a tuple with the 3 values of acceleration (G).
Read the current roll from the LIS2HH12. Returns a float in degrees.
Read the current pitch from the LIS2HH12. Returns a float in degrees.
Read the current yaw from the LIS2HH12. Returns a float in degrees.
Digital Ambient Light Sensor (LTR-329ALS-01)
Pysense has a dual light sensor that provides outputs for external light levels in lux. See the datasheet for more information about the wavelengths of the two sensors.
Constructors
Creates a LTR329ALS01 object, that will return values for light in lux. Constructor must be passed a Pysense or I2C object to successfully construct.
Methods
Read the light levels of both LTR329ALS01 sensors. Returns a tuple with two values for light levels in lux.
Arguments
The following arguments may be passed into the constructor.
gain
integration
rate
Humidity and Temperature Sensor (SI7006A20)
Pysense has a Humidity and Temperature sensor that provides values of relative humidity and external temperature.
Constructors
Creates a SI7006A20 object, that will return values for humidity (%) and temperature ('C). Constructor must be passed a Pysense or I2C object to successfully construct.
Methods
Read the relative humidity of the SI7006A20. Returns a float with the percentage relative humidity.
Read the external temperature of the SI7006A20. Returns a float with the temperature.
Barometric Pressure Sensor with Altimeter (MPL3115A2)
Pysense has a Barometric Pressure sensor that provides readings for pressure, altitude as well as an additional temperature sensor.
Constructors
Creates a MPL3115A2 object, that will return values for pressure (Pa), altitude (m) and temperature ('C). Constructor must be passed a Pysense or I2C object to successfully construct.
Methods
Read the atmospheric pressure of the MPL3115A2. Returns a float with the pressure in (Pa).
Read the altitude of the MPL3115A2. Returns a float with the altitude in (m).
Read the temperature of the MPL3115A2. Returns a float with the temperature in ('C).
Arguments
The following arguments may be passed into the constructor.
mode
Please note that more functionality is being added weekly to these libraries. If a required feature is not available, feel free to contribute with a pull request at the Libraries GitHub repository