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


8595
8596
8597
# File 'Monkeybrains.rb', line 8595

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.


8572
8573
8574
# File 'Monkeybrains.rb', line 8572

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


8546
8547
8548
# File 'Monkeybrains.rb', line 8546

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


8589
8590
8591
# File 'Monkeybrains.rb', line 8589

def heading
  @heading
end

heartRateToybox::Lang::Number

The heart rate in beats per minute (bpm).

Returns:

Since:

  • 1.0.0


8551
8552
8553
# File 'Monkeybrains.rb', line 8551

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


8602
8603
8604
# File 'Monkeybrains.rb', line 8602

def mag
  @mag
end

powerToybox::Lang::Number

The power in Watts (W).

Returns:

Since:

  • 1.0.0


8556
8557
8558
# File 'Monkeybrains.rb', line 8556

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


8582
8583
8584
# File 'Monkeybrains.rb', line 8582

def pressure
  @pressure
end

speedToybox::Lang::Float

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

Returns:

See Also:

Since:

  • 1.0.0


8535
8536
8537
# File 'Monkeybrains.rb', line 8535

def speed
  @speed
end

temperatureToybox::Lang::Float

The temperature in degrees Celsius (C).

Returns:

Since:

  • 1.0.0


8561
8562
8563
# File 'Monkeybrains.rb', line 8561

def temperature
  @temperature
end