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)).


8714
8715
8716
# File 'Monkeybrains.rb', line 8714

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


8729
8730
8731
# File 'Monkeybrains.rb', line 8729

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).


8723
8724
8725
# File 'Monkeybrains.rb', line 8723

def roll
  @roll
end

xToybox::Lang::Array

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

Returns:

Since:

  • 2.3.0


8692
8693
8694
# File 'Monkeybrains.rb', line 8692

def x
  @x
end

yToybox::Lang::Array

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

Returns:

Since:

  • 2.3.0


8698
8699
8700
# File 'Monkeybrains.rb', line 8698

def y
  @y
end

zToybox::Lang::Array

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

Returns:

Since:

  • 2.3.0


8704
8705
8706
# File 'Monkeybrains.rb', line 8704

def z
  @z
end