Class: Toybox::Sensor::AccelerometerData

Inherits:
Lang::Object show all

Overview

A class to store accelerometer sample history data.

Each field specified is an Array of Float or Number values. The values for the x, y, and z axes are in Milli G units. For reference, 1000 Milli G = 1 G. If not null, all fields are of equal size. This is typically used in a callback method used by registerSensorDataListener()

See Also:

Since:

  • 2.3.0

Instance Attribute Summary collapse

Method Summary

Methods inherited from Lang::Object

equals, hashCode, method, toString, weak

Instance Attribute Details

pitchToybox::Lang::Array

The Array of pitch values as Floats in degrees. Can be null.

Pitch values are calculated with the equation atan2(y, sqrt(x^2 + z^2)).


9864
9865
9866
# File 'Monkeybrains.rb', line 9864

def pitch
  @pitch
end

powerToybox::Lang::Array

The Array of vector power values as Numbers in millig-units. Can be null.

Returns:

Since:

  • 2.3.0


9879
9880
9881
# File 'Monkeybrains.rb', line 9879

def power
  @power
end

rollToybox::Lang::Array

The Array of roll values as Floats in degrees. Can be null.

Roll values are calculated with the equation atan2(-x, z).


9873
9874
9875
# File 'Monkeybrains.rb', line 9873

def roll
  @roll
end

xToybox::Lang::Array

The Array of x axis values as Numbers in millig-units.

Returns:

Since:

  • 2.3.0


9842
9843
9844
# File 'Monkeybrains.rb', line 9842

def x
  @x
end

yToybox::Lang::Array

The Array of y axis values as Numbers in millig-units.

Returns:

Since:

  • 2.3.0


9848
9849
9850
# File 'Monkeybrains.rb', line 9848

def y
  @y
end

zToybox::Lang::Array

The Array of z axis values as Numbers in millig-units.

Returns:

Since:

  • 2.3.0


9854
9855
9856
# File 'Monkeybrains.rb', line 9854

def z
  @z
end