QuadroCopter  0.1.4
LSM303Accelerometer.h
Go to the documentation of this file.
1 //
2 // Created by Michael Brookes on 05/05/2016.
3 //
4 
5 #ifndef LSM303_ACCELEROMETER_LSM303ACCELEROMETER_H
6 #define LSM303_ACCELEROMETER_LSM303ACCELEROMETER_H
7 #define EMERGENCY_ROLL 25
8 #define EMERGENCY_PITCH 25
9 
10 #include "../LSM303DLHC.h"
11 #include <bitset>
12 #include <math.h>
13 
14 namespace quadro {
15 
16  namespace i2c {
17 
18  using namespace std;
19 
21 
22  public:
23 
31  LSM303Accelerometer( unsigned char _deviceAddress = ACCEL_ADDRESS, int _busId = 1 );
32 
39  float calcRoll();
40 
47  float calcPitch();
48 
56  int start();
57 
58  float pitch;
59 
60  float roll;
61 
62  pthread_t threadHandle;
63 
64  private:
65 
74  static void* runMainSensorUpdateThread( void* static_inst );
75 
76 
77  int threadRet;
78  };
79 
80  }
81 }
82 
83 #endif //LSM303_ACCELEROMETER_LSM303ACCELEROMETER_H
Definition: LSM303DLHC.h:351
Definition: LSM303Accelerometer.h:20
float roll
Stores the calculated Roll value.
Definition: LSM303Accelerometer.h:60
Definition: aeronautics.h:23
#define ACCEL_ADDRESS
I2C Address of the accelerometer device.
Definition: LSM303DLHC.h:29
float pitch
Stores the calculated Pitch value.
Definition: LSM303Accelerometer.h:58