     mx = map(accel.acceleration.y - yNormal, -20, 20, 200, -200);
   }
   Mouse.move(mx, my, 0);
-
-//  print out accelleration data
-//  Serial.print("Accel X: "); Serial.print(accel.acceleration.x); Serial.print(" ");
-//  Serial.print("  \tY: "); Serial.print(accel.acceleration.y);   Serial.print(" ");
-//  Serial.print("  \tZ: "); Serial.print(accel.acceleration.z);   Serial.println("  \tm/s^2");
-//  Serial.print("Magn. X: "); Serial.print(mag.magnetic.x); Serial.print(" ");
-//  Serial.print("  \tY: "); Serial.print(mag.magnetic.y);       Serial.print(" ");
-//  Serial.print("  \tZ: "); Serial.print(mag.magnetic.z);     Serial.println("  \tgauss");
-//  Serial.print("Gyro  X: "); Serial.print(gyro.gyro.x); Serial.print(" ");
-//  Serial.print("  \tY: "); Serial.print(gyro.gyro.y);       Serial.print(" ");
-//  Serial.print("  \tZ: "); Serial.print(gyro.gyro.z);     Serial.println("  \tdps");
-//  Serial.print("Temp: "); Serial.print(temp.temperature); Serial.println(" *C");
-
   delay(10);
+}
+
+void mpr_loop() {
+ // Get the currently touched pads
+  currtouched = cap.touched();
+  
+  for (uint8_t i=0; i < 12; i++) {
+    // it if *is* touched and *wasnt* touched before, alert!
+    if ((currtouched & _BV(i)) && !(lasttouched & _BV(i)) ) {
+      Serial.print(i); Serial.println(" touched");
+    }
+    // if it *was* touched and now *isnt*, alert!
+    if (!(currtouched & _BV(i)) && (lasttouched & _BV(i)) ) {
+      Serial.print(i); Serial.println(" released");
+    }
+  }
+
+  // reset our state
+  lasttouched = currtouched;
+
+  // comment out this line for detailed data from the sensor!
+  return;
+  
+  // debugging info, what
+  Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t\t 0x"); Serial.println(cap.touched(), HEX);
+  Serial.print("Filt: ");
+  for (uint8_t i=0; i < 12; i++) {
+    Serial.print(cap.filteredData(i)); Serial.print("\t");
+  }
+  Serial.println();
+  Serial.print("Base: ");
+  for (uint8_t i=0; i < 12; i++) {
+    Serial.print(cap.baselineData(i)); Serial.print("\t");
+  }
+  Serial.println();
+  
+  // put a delay so it isn't overwhelming
+  delay(100); 
 }
 
 void calibrate(float x, float y) {

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_LSM9DS0.h>

/* This driver uses the Adafruit unified sensor library (Adafruit_Sensor),
   which provides a common 'type' for sensor data and some helper functions.


float xNormal = -3.0;
float yNormal = 1;
float xRange[] = {0,0};
float yRange[] = {0,0};

// MPR121
// You can have up to 4 on one i2c bus but one is enough for testing!
Adafruit_MPR121 cap = Adafruit_MPR121();

uint16_t lasttouched = 0;
uint16_t currtouched = 0;

// Configures the gain and integration time for the TSL2561

void configureSensor(void) {
  // 1.) Set the accelerometer range
  //lsm.setupAccel(lsm.LSM9DS0_ACCELRANGE_2G);
