Subversion Repositories FlightCtrl

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1993 - 1
#include <ADXL345.h>
2
#include <HMC58X3.h>
3
#include <ITG3200.h>
4
 
5
//#define DEBUG
6
#include "DebugUtils.h"
7
 
8
#include "FreeIMU.h"
9
#include "CommunicationUtils.h"
10
#include <Wire.h>
11
 
12
int raw_values[9];
13
//char str[512];
14
float ypr[3]; // yaw pitch roll
15
float val[9];
16
 
17
// Set the FreeIMU object
18
FreeIMU my3IMU = FreeIMU();
19
 
20
void setup() {
21
  Serial.begin(115200);
22
  Wire.begin();
23
 
24
  delay(5);
25
  my3IMU.init(); // the parameter enable or disable fast mode
26
  delay(5);
27
}
28
 
29
void loop() {
30
 
31
  my3IMU.getYawPitchRoll(ypr);
32
  Serial.print("Yaw: ");
33
  Serial.print(ypr[0]);
34
  Serial.print(" Pitch: ");
35
  Serial.print(ypr[1]);
36
  Serial.print(" Roll: ");
37
  Serial.print(ypr[2]);
38
  Serial.println("");
39
 
40
  delay(10);
41
}
42
 
43
 
44