#include <ADXL345.h>
#include <bma180.h>
#include <HMC58X3.h>
#include <ITG3200.h>
#include <MS561101BA.h>
#include <I2Cdev.h>
#include <MPU60X0.h>
#include <EEPROM.h>
//#define DEBUG
#include "DebugUtils.h"
#include "CommunicationUtils.h"
#include "FreeIMU.h"
#include <Wire.h>
#include <SPI.h>
#include "FastLED.h"
#define SPINE_COUNT 30
#define SPINE_PIN 6
CRGB leds[SPINE_COUNT];
#define LED 13
int raw_values[9];
//char str[512];
float ypr[3]; // yaw pitch roll
float val[9];
// Set the FreeIMU object
FreeIMU my3IMU = FreeIMU();
void setup() {
Serial.begin(57600);
Serial.println("hi");
FastLED.addLeds<NEOPIXEL, SPINE_PIN>(leds, SPINE_COUNT);
Wire.begin();
pinMode(LED,OUTPUT);
my3IMU.init(); // the parameter enable or disable fast mode
delay(5);
}
void loop() {
digitalWrite(LED, HIGH);
my3IMU.getYawPitchRoll(ypr);
Serial.print("Yaw: ");
Serial.print(ypr[0]);
Serial.print(" Pitch: ");
Serial.print(ypr[1]);
Serial.print(" Roll: ");
Serial.print(ypr[2]);
Serial.println("");
static uint8_t hue = 0;
// WHEN THIS NEXT LINE COMMENTED OUT I GET GOOD IMU DATAS
FastLED.showColor(CHSV(hue++, 255, 255));
delay(10);
}