« Back to documentation index 
    
IMU Class Reference 
This is a device driver class for the ST LSM9DS0 inertial measurement unit.  
More... 
#include <IMU.h >
  IMU  (SPI &spi, DigitalOut &csG, DigitalOut &csXM)  Creates an IMU  object.   virtual  ~IMU  ()  Deletes the IMU  object.   float  readGyroX  ()  Reads the gyroscope about the x-axis.   float  readGyroY  ()  Reads the gyroscope about the y-axis.   float  readGyroZ  ()  Reads the gyroscope about the z-axis.   float  readAccelerationX  ()  Reads the acceleration in x-direction.   float  readAccelerationY  ()  Reads the acceleration in y-direction.   float  readAccelerationZ  ()  Reads the acceleration in z-direction.   float  readMagnetometerX  ()  Reads the magnetic field in x-direction.   float  readMagnetometerY  ()  Reads the magnetic field in x-direction.   float  readMagnetometerZ  ()  Reads the magnetic field in x-direction.   float  readHeading  ()  Reads the compass heading about the z-axis.   
Detailed Description 
This is a device driver class for the ST LSM9DS0 inertial measurement unit. 
Definition at line 17  of file IMU.h .
Constructor & Destructor Documentation 
      
        
          IMU  ( 
          SPI &  
           spi ,  
         
        
          DigitalOut &  
           csG ,  
         
        
          DigitalOut &  
           csXM   
         
        
          ) 
           
      
 
Creates an IMU  object. 
Parameters: 
  
    spi a reference to an spi controller to use.  csG the chip select output for the gyro sensor.  csXM the chip select output for the accelerometer and the magnetometer.  
   
Definition at line 22  of file IMU.cpp .
 
 
Deletes the IMU  object. 
Definition at line 78  of file IMU.cpp .
 
 
Member Function Documentation 
      
        
          float readAccelerationX  
          ( 
           ) 
           
      
 
Reads the acceleration in x-direction. 
Returns: the acceleration in x-direction, given in [m/s2].  Definition at line 160  of file IMU.cpp .
 
 
      
        
          float readAccelerationY  
          ( 
           ) 
           
      
 
Reads the acceleration in y-direction. 
Returns: the acceleration in y-direction, given in [m/s2].  Definition at line 174  of file IMU.cpp .
 
 
      
        
          float readAccelerationZ  
          ( 
           ) 
           
      
 
Reads the acceleration in z-direction. 
Returns: the acceleration in z-direction, given in [m/s2].  Definition at line 188  of file IMU.cpp .
 
 
Reads the gyroscope about the x-axis. 
Returns: the rotational speed about the x-axis given in [rad/s].  Definition at line 118  of file IMU.cpp .
 
 
Reads the gyroscope about the y-axis. 
Returns: the rotational speed about the y-axis given in [rad/s].  Definition at line 132  of file IMU.cpp .
 
 
Reads the gyroscope about the z-axis. 
Returns: the rotational speed about the z-axis given in [rad/s].  Definition at line 146  of file IMU.cpp .
 
 
Reads the compass heading about the z-axis. 
Returns: the compass heading in the range -PI to +PI, given in [rad].  Definition at line 244  of file IMU.cpp .
 
 
      
        
          float readMagnetometerX  
          ( 
           ) 
           
      
 
Reads the magnetic field in x-direction. 
Returns: the magnetic field in x-direction, given in [Gauss].  Definition at line 202  of file IMU.cpp .
 
 
      
        
          float readMagnetometerY  
          ( 
           ) 
           
      
 
Reads the magnetic field in x-direction. 
Returns: the magnetic field in x-direction, given in [Gauss].  Definition at line 216  of file IMU.cpp .
 
 
      
        
          float readMagnetometerZ  
          ( 
           ) 
           
      
 
Reads the magnetic field in x-direction. 
Returns: the magnetic field in x-direction, given in [Gauss].  Definition at line 230  of file IMU.cpp .