Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of IMUdriver by
Revision 7:5e299dbf98ff, committed 2015-06-05
- Comitter:
- cashdollar
- Date:
- Fri Jun 05 17:25:03 2015 +0000
- Parent:
- 6:d9198ff2dcf9
- Child:
- 8:a8f6366e4b7b
- Commit message:
- Added documentation for getAccTilt
Changed in this revision
| MPU6000.cpp | Show annotated file Show diff for this revision Revisions of this file |
| MPU6000.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/MPU6000.cpp Wed Jun 03 19:00:43 2015 +0000
+++ b/MPU6000.cpp Fri Jun 05 17:25:03 2015 +0000
@@ -219,8 +219,7 @@
}
-// Get Tilt Angle from Accerometer
-
+// Get Tilt Angle from Accelerometer
float mpu6000_spi::getAccTilt()
{
float Z,X;
--- a/MPU6000.h Wed Jun 03 19:00:43 2015 +0000
+++ b/MPU6000.h Fri Jun 05 17:25:03 2015 +0000
@@ -53,7 +53,7 @@
bool init(int sample_rate_div,int low_pass_filter);
float read_acc(int axis);
float read_rot(int axis);
- float getAccTilt();
+
unsigned int set_gyro_scale(int scale);
unsigned int set_acc_scale(int scale);
int calib_acc(int axis);
@@ -63,7 +63,12 @@
unsigned int whoami();
float acc_divider;
float gyro_divider;
-
+
+ /** Collects torso tilt from vertical using accelerometer only.
+ * @returns Tilt angle relative to vertical
+ */
+ float getAccTilt();
+
/** Masks current whoami() value against expected value.
* @returns
* 0 is safe
@@ -87,7 +92,7 @@
PinName _CS_pin;
PinName _SO_pin;
PinName _SCK_pin;
-
+
/** Accelerometer acceleration using a complementary filter.
*/
float accFilterCurrent;
