Class: Toybox.Sensor.Info
- Inherits:
-
Toybox.Lang.Object
Overview
The Sensor.Info class contains all of the information provided by enabled sensors.
Sensor.Info can be retrieved on every call of
onUpdate() or it can be obtained on demand.
Fields in this class may return null
so should be checked for null
values
prior to use.
Instance Member Summary collapse
-
accel as Lang.Array<Lang.Number> or Null
The accelerometer reading of the x, y, and z axes as an Array of Number values in millig-units.
-
altitude as Lang.Float or Null
The altitude above mean sea level in meters (m).
-
cadence as Lang.Number or Null
The cadence in revolutions per minute (rpm).
-
heading as Lang.Float or Null
The true north referenced heading in radians.
-
heartRate as Lang.Number or Null
The heart rate in beats per minute (bpm).
-
mag as Lang.Array<Lang.Number> or Null
The magnetometer reading of the x, y, and z axes as an Array of Number values in milliGauss (mG).
-
oxygenSaturation as Lang.Number or Null
The current oxygen saturation in percent (%).
-
power as Lang.Number or Null
The power in Watts (W).
-
pressure as Lang.Float or Null
The barometric pressure in Pascals (Pa).
-
speed as Lang.Float or Null
The speed in meters per second (m/s).
-
temperature as Lang.Float or Null
The temperature in degrees Celsius (C).
Instance Attribute Details
var accel as Lang.Array<Lang.Number> or Null
The accelerometer reading of the x, y, and z axes as an Array of Number values in millig-units.
var altitude as Lang.Float or Null
The altitude above mean sea level in meters (m).
Elevation is derived from the most accurate source: Barometer or GPS in order of descending accuracy. If no GPS is present, then barometer readings will be used.
var cadence as Lang.Number or Null
The cadence in revolutions per minute (rpm).
Cadence is derived from (in order of priority):
-
Bike sensors (cadence or speed must be enabled)
-
Advanced running dynamics sensors (e.g. heart strap with running dynamics enabled)
-
Foot pod
-
Watch-based cadence calculations
var heading as Lang.Float or Null
The true north referenced heading in radians.
This provides compass orientation if it is supported by the device.
var heartRate as Lang.Number or Null
The heart rate in beats per minute (bpm).
var mag as Lang.Array<Lang.Number> or Null
The magnetometer reading of the x, y, and z axes as an Array of Number values in milliGauss (mG).
var oxygenSaturation as Lang.Number or Null
The current oxygen saturation in percent (%)
var power as Lang.Number or Null
The power in Watts (W).
var pressure as Lang.Float or Null
The barometric pressure in Pascals (Pa).
This returns barometric pressure calibrated to sea level. Since pressure varies dues to several factors, a GPS-based altitude must first be obtained, then the ambient (local) pressure is measured by the pressure sensor before conversion to a calibrated barometric pressure value.
var speed as Lang.Float or Null
The speed in meters per second (m/s).
var temperature as Lang.Float or Null
The temperature in degrees Celsius (C).