Class: HMC5883L
- Inherits:
-
Object
- Object
- HMC5883L
- Defined in:
- ext/bonekit/hmc5883l_class.c
Class Method Summary collapse
-
.initialize ⇒ HMC5883L
Returns a new HMC5883L object.
Instance Method Summary collapse
-
#heading ⇒ Float
Returns a Float with the heading value in degrees ([-180,180]).
Class Method Details
.initialize ⇒ HMC5883L
Returns a new HMC5883L object.
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
#heading ⇒ Float
Returns a Float with the heading value in degrees ([-180,180]).
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); } |