   Serial.print(" - ");
   magn.describe();
 
-  Serial.println();
-  delay(100);
+  PROMPT;
 }

void setup() {
  Serial.begin(BAUD);
  
  accel.init();
  gyro.init();
  magn.init();

  Serial.print("Calibration...");
  accel.calibrate(50, 2);
  gyro.calibrate(50, 2);
  magn.calibrate(50, 2);
  Serial.println("done.");
  PROMPT;
}

void loop() {
  accel.update();
  gyro.update();
  magn.update();


#include <Wire.h>
#include <I2CDevices.h>
#include <FiniteStateMachine.h>

#define BAUD 9600
#define PROMPT Serial.println(">");

State Idle = State(wait_state);
State Run  = State(measure_state); 
State Calibrate  = State(calibrate_state); 
FSM StateMachine = FSM(Calibrate);

I2CAccel accel  = I2CAccel(); // default 0x53
I2CGyro  gyro   = I2CGyro();  // default 0x68
