Class: Toybox::Sensor::Info

Inherits:
Lang::Object show all

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.

Since:

  • 1.0.0

Instance Attribute Summary collapse

Method Summary

Methods inherited from Lang::Object

equals, hashCode, method, toString, weak

Instance Attribute Details

accelToybox::Lang::Array

The accelerometer reading of the x, y, and z axes as an Array of Number values in millig-units.

Returns:

Since:

  • 1.2.0


9748
9749
9750
# File 'Monkeybrains.rb', line 9748

def accel
  @accel
end

altitudeToybox::Lang::Float

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.


9725
9726
9727
# File 'Monkeybrains.rb', line 9725

def altitude
  @altitude
end

cadenceToybox::Lang::Number

The cadence in revolutions per minute (rpm).

Cadence is derived from (in order of priority):

  1. Bike sensors (cadence or speed must be enabled)

  2. Advanced running dynamics sensors (e.g. heart strap with running dynamics enabled)

  3. Foot pod

  4. Watch-based cadence calculations

Returns:

Since:

  • 1.0.0


9699
9700
9701
# File 'Monkeybrains.rb', line 9699

def cadence
  @cadence
end

headingToybox::Lang::Float

The true north referenced heading in radians.

This provides compass orientation if it is supported by the device.

Returns:

Since:

  • 1.0.0


9742
9743
9744
# File 'Monkeybrains.rb', line 9742

def heading
  @heading
end

heartRateToybox::Lang::Number

The heart rate in beats per minute (bpm).

Returns:

Since:

  • 1.0.0


9704
9705
9706
# File 'Monkeybrains.rb', line 9704

def heartRate
  @heartRate
end

magToybox::Lang::Array

The magnetometer reading of the x, y, and z axes as an Array of Number values in milliGauss (mG).

Returns:

Since:

  • 1.2.0

Supported Devices:

  • All devices except Edge and vivoactive


9755
9756
9757
# File 'Monkeybrains.rb', line 9755

def mag
  @mag
end

powerToybox::Lang::Number

The power in Watts (W).

Returns:

Since:

  • 1.0.0


9709
9710
9711
# File 'Monkeybrains.rb', line 9709

def power
  @power
end

pressureToybox::Lang::Float

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.

Returns:

Since:

  • 1.0.0


9735
9736
9737
# File 'Monkeybrains.rb', line 9735

def pressure
  @pressure
end

speedToybox::Lang::Float

The speed in meters per second (m/s).

Returns:

See Also:

Since:

  • 1.0.0


9688
9689
9690
# File 'Monkeybrains.rb', line 9688

def speed
  @speed
end

temperatureToybox::Lang::Float

The temperature in degrees Celsius (C).

Returns:

Since:

  • 1.0.0


9714
9715
9716
# File 'Monkeybrains.rb', line 9714

def temperature
  @temperature
end