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 LSM9DS0 by
Diff: LSM9DS0.h
- Revision:
- 10:60a176bd72b3
- Parent:
- 3:bc0db184f092
--- a/LSM9DS0.h Tue Oct 25 06:21:28 2016 +0000 +++ b/LSM9DS0.h Wed Dec 28 16:44:09 2016 +0000 @@ -20,6 +20,8 @@ #define __SFE_LSM9DS0_H__ #include "mbed.h" +#include <vector> +using std::vector; #define PI 3.14159 @@ -203,6 +205,10 @@ M_ODR_50 = 0x04, // 50 (0x04) M_ODR_100 = 0x05, // 100 Hz (0x05) }; + + // Unit transformation + float deg2rad; // = 3.1415926/180.0; + float rad2deg; // = 180.0/3.1415926; // We'll store the gyro, accel, and magnetometer readings in a series of // public class variables. Each sensor gets three variables -- one for each @@ -262,6 +268,9 @@ // The readings are stored in the class' gx, gy, and gz variables. Read // those _after_ calling readGyro(). void readGyro(); + void readGyroFloatVector_degPs(vector<float> &v_out); // Read to float array v_out[] + void readGyroFloatVector_radPs(vector<float> &v_out); // Read to float array v_out[] + void readGyroRawVector(vector<int16_t> &v_out); // Raw data in int16_t int16_t readRawGyroX( void ); int16_t readRawGyroY( void ); int16_t readRawGyroZ( void ); @@ -274,6 +283,8 @@ // The readings are stored in the class' ax, ay, and az variables. Read // those _after_ calling readAccel(). void readAccel(); + void readAccelFloatVector(vector<float> &v_out); // Read to float array v_out[] + void readAccelRawVector(vector<int16_t> &v_out); // Raw data in int16_t int16_t readRawAccelX( void ); int16_t readRawAccelY( void ); int16_t readRawAccelZ( void ); @@ -286,6 +297,8 @@ // The readings are stored in the class' mx, my, and mz variables. Read // those _after_ calling readMag(). void readMag(); + void readMagFloatVector(vector<float> &v_out); // Read to float array v_out[] + void readMagRawVector(vector<int16_t> &v_out); // Raw data in int16_t int16_t readRawMagX( void ); int16_t readRawMagY( void ); int16_t readRawMagZ( void );