     Bluetooth.println("DBluetooth module active.");
 }
 
+float trapezoidalRule(float fa, float fb, int dt) {
+    return (float) dt * fa * fb * 0.5;
+}
+
+//float rk4(float(*f)(float, float), float dt, float t, float y)
+//{
+//    float  k1 = dt * f(t, y),
+//            k2 = dt * f(t + dt / 2, y + k1 / 2),
+//            k3 = dt * f(t + dt / 2, y + k2 / 2),
+//            k4 = dt * f(t + dt, y + k3);
+//    return y + (k1 + 2 * k2 + 2 * k3 + k4) / 6;
+//
+//}
+

// tells that accelerometer data is ready
volatile bool accDataReady = false;

// declarations
void setupBluetooth();
bool setupAccelerometer();
void setDataReady() {accDataReady = true;}


void setup() {


// accuracy: +- 2, +- 4, +- 8
#define AccelerationRange MMA_RANGE_2G
#define AccelerationDataRate MMA_100hz


// Used for blinking on error
