Arduino Toolkit - lps22hb
Methods
- :
obj =
lps22hb(arObj) - :
obj =
lps22hb(arObj,propertyname, propertyvalue ....)
Constructor to create LPS22HB sensor
Inputs
arObj - the arduino parent object
propertyname, propertyvalue - optional property name, value pairs. Current known properties are: Current properties are:
- I2CAddress
I2C address of the sensor (default 0x5C)
- Bus
I2C bus - 0 or 1 (default 0)
Outputs
obj - created object
Example
a = arduino() sensor = lps22hb(a)
- :
[C, timestamp] =
readTemperature(obj) Read the temperature
Inputs
obj - the sensor object
Outputs
C - read temperature in deg C.
timestamp - timestamp when read
Example
a = arduino() s = lps22hb(a) # get temp temp = s.readTemperature
See also: lps22hb.
- :
[P, timestamp] =
readPressure(obj) Read the pressure
Inputs
obj - the sensor object
Outputs
P - pressure reading from sensor.
timestamp - timestamp when read
- :
[readings, overrun] =
read(obj) - :
[P, C, timestamp, overrun] =
read(obj) Read the sensor data
Inputs
obj - the sensor object
Outputs
P - pressure reading from sensor.
C - temperature reading from sensor.
timestamp - timestamp when read
overrun - overrun flag.
readings - table structure with fields for Timestamp, Pressure, Temperature and Humidity.
- :
inf =
info(obj) Read the sensor info
Inputs
obj - the sensor object
Outputs
inf - structure containing the sensor information.
Structure fields are:
- Version
Chip firmware version
- SensorId
sensor id value
- Type
sensor type ’lps22hb’
- Status
Status value read from sensor