Module:xbee sensor
From Digi Developer
The xbee_sensor module provides a convenient object interface for parsing sensor data returned from Digi XBee™ Sensor Adapters. Sensor data is obtained from an XBee Sensor adapter by using the 1S command of the DDO (“Digi Data Objects”) interface. See the ddo_get_param() function for details.
Contents |
XBeeWatchportA
XBeeWatchportA – interpret 1S sample for Watchport®/A accelerometer.
Attributes
- xout
- acceleration in force units g along the x axis.
- yout
- acceleration in force units g along the y axis.
- pitch
- degrees of tilt along x axis (-90° = x = 90°).
- roll
- degrees of tilt along y axis (-90° = y = 90°).
Methods
XBeeWatchportA()
- Purpose
construct a new XBeeWatchportA object.
- Syntax
XBeeWatchportA()
- Description
Create a XBeeWatchportA object in order to parse DDO 1S samples into real-world units.
set_0g_calibration()
- Purpose
Calibrate the accelerometer to 0 at rest.
- Syntax
set_0g_calibration(sample) . None
- Description
This method is used to calibrate the object for use with samples from a Watchport/A accelerometer. Place the sensor flat, aligning both the X and Y axis at 0°, acquire a 1S sample from the XBee Adapter via DDO, and call this method with the sample. The object will then be calibrated for this accelerometer.
parse_sample()
- Purpose
parse a 1S sample into real-world units.
- Syntax
parse_sample(sample) . self
- Description
This method parses a given DDO 1S sample into real world units. After calling this function, the sensor data will be available by accessing the object’s attributes.
XBeeWatchportD
XBeeWatchportD – interpret 1S sample for Watchport/D distance sensor.
Attributes
- distance
- distance from sensor in cm (20 cm = x = 150 cm).
Methods
XBeeWatchportD()
- Purpose
construct a new XBeeWatchportD object.
- Syntax
XBeeWatchportD()
- Description
Create a XBeeWatchportD object for parsing DDO 1S samples into real-world units.
parse_sample()
- Purpose
parse a 1S sample into real–world units.
- Syntax
parse_sample(sample) . self
- Description
This method parses a given DDO 1S sample into real-world units. After calling this function, the sensor data is available by accessing the object’s attributes.
XBeeWatchportH
XBeeWatchportH – interpret 1S sample for Watchport/H humidity sensor
Attributes
- sensor_rh
- relative humidity without considering temperature component.
- true_rh
- true relative humidity derived from considering ambient temperature.
- temperature
- temperature in degrees Celsius.
Methods
XBeeWatchportH()
- Purpose
construct a new XBeeWatchportH object
- Syntax
XBeeWatchportH()
- Description
Create a XBeeWatchportH object in order to parse DDO 1S samples into real-world units.
parse_sample()
- Purpose
parse a 1S sample into real-world units.
- Syntax
parse_sample(sample) . self
- Description
This method parses a given DDO 1S sample into real-world units. After calling this function, the sensor data is available by accessing the object’s attributes.
XBeeWatchportT
XBeeWatchportT – interpret 1S sample for Watchport/T temperature sensor
Attributes
- temperature
- temperature in degrees Celsius.
Methods
XBeeWatchportT()
- Purpose
construct a new XBeeWatchportT object.
- Syntax
XBeeWatchportT()
- Description
Create a XBeeWatchportT object in order to parse DDO 1S samples into real-world units.
parse_sample()
- Purpose
parse a 1S sample into real-world units.
- Syntax
parse_sample(sample) . self
- Description
This method parses a given DDO 1S sample into real-world units. After calling this function, the sensor data is available by accessing the object’s attributes.
