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


9745
9746
9747
# File 'Monkeybrains.rb', line 9745

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.


9722
9723
9724
# File 'Monkeybrains.rb', line 9722

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


9696
9697
9698
# File 'Monkeybrains.rb', line 9696

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


9739
9740
9741
# File 'Monkeybrains.rb', line 9739

def heading
  @heading
end

heartRateToybox::Lang::Number

The heart rate in beats per minute (bpm).

Returns:

Since:

  • 1.0.0


9701
9702
9703
# File 'Monkeybrains.rb', line 9701

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


9752
9753
9754
# File 'Monkeybrains.rb', line 9752

def mag
  @mag
end

powerToybox::Lang::Number

The power in Watts (W).

Returns:

Since:

  • 1.0.0


9706
9707
9708
# File 'Monkeybrains.rb', line 9706

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


9732
9733
9734
# File 'Monkeybrains.rb', line 9732

def pressure
  @pressure
end

speedToybox::Lang::Float

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

Returns:

See Also:

Since:

  • 1.0.0


9685
9686
9687
# File 'Monkeybrains.rb', line 9685

def speed
  @speed
end

temperatureToybox::Lang::Float

The temperature in degrees Celsius (C).

Returns:

Since:

  • 1.0.0


9711
9712
9713
# File 'Monkeybrains.rb', line 9711

def temperature
  @temperature
end