imu01c
Diff: LSM303D.cpp
- Revision:
- 1:5d0acf280330
- Parent:
- 0:456611adedf8
- Child:
- 2:4bfc36c368c2
--- a/LSM303D.cpp Sat Oct 31 16:14:13 2015 +0000 +++ b/LSM303D.cpp Sat Oct 31 16:28:12 2015 +0000 @@ -134,16 +134,16 @@ void LSM303D::setOffset(float x, float y, float z) { - _offset.x = x; - _offset.y = y; - _offset.z = z; + _offset_x = x; + _offset_y = y; + _offset_z = z; } void LSM303D::setScale(float x, float y, float z) { - _scale.x = x; - _scale.y = y; - _scale.z = z; + _scale_x = x; + _scale_y = y; + _scale_z = z; } void LSM303D::set_vectors() @@ -161,9 +161,9 @@ acc.z = (float) (_filt_az >> FILTER_SHIFT); // offset and scale - mag.x = (3 * mag.x + ((mag_raw.x + _offset.x) * _scale.x))/4; - mag.y = (3 * mag.y + ((mag_raw.y + _offset.y) * _scale.y))/4; - mag.z = (3 * mag.z + ((mag_raw.z + _offset.z) * _scale.z))/4; + mag.x = (3 * mag.x + ((mag_raw.x + _offset_x) * _scale_x))/4; + mag.y = (3 * mag.y + ((mag_raw.y + _offset_y) * _scale_y))/4; + mag.z = (3 * mag.z + ((mag_raw.z + _offset_z) * _scale_z))/4; vector_normalize(&mag); }