Class: HMC5883L

Inherits:
Object
  • Object
show all
Defined in:
ext/bonekit/hmc5883l_class.c

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.initializeHMC5883L

Returns a new HMC5883L object.

Returns:



49
50
51
52
53
54
# File 'ext/bonekit/hmc5883l_class.c', line 49

static VALUE HMC5883L_new(VALUE class)
{
  hmc5883l_t * ptr = hmc5883l_create();
  VALUE wrap_struct = Data_Wrap_Struct(class, 0, HMC5883L_free, ptr);
  return wrap_struct;
}

Instance Method Details

#headingFloat

Returns a Float with the heading value in degrees ([-180,180]).

Returns:

  • (Float)


62
63
64
65
66
67
68
69
# File 'ext/bonekit/hmc5883l_class.c', line 62

static VALUE HMC5883L_heading(VALUE self)
{
  double value = 0.0f;
  hmc5883l_t * ptr;
  Data_Get_Struct(self, hmc5883l_t, ptr);
  value = hmc5883l_heading(ptr);
  return rb_float_new(value);
}