 int ledPin = 8;
 int state = 0;
 int softpotReading = 0;
+int softpotInitV = 0;
+int delta_threshold = 0;
+int changes = 0;
 struct XBeePacket XBeePacketArr[20];
 volatile int XBeePacketCounter;
 volatile int selectedXBee;
 unsigned long start_time;
+unsigned long last_release_time;
+bool released;
+bool pressed;
 unsigned long end_time;
+
+
+int readXBeeString (char *strArray) {
+  int i = 0;
+  if(!XBee.available()) {
+    return -1;
+  }
+  while (XBee.available()) {
+    strArray[i] = XBee.read();
+    i++;
+  }
+  strArray[i] = '\0';
+  return i;
+}
 
 void setup()
 {

  digitalWrite(ledPin, LOW);
  XBee.begin(9600);
  XBeePacketCounter = 0;
}

void loop() {

#define VERIFY 4
#define CONNECTED 5
#define SOFTPOT_THREASHOLD 950
#define SOFTPOT_DELTA_THREASHOLD 111
#define DELAY_IN_WAIT 1000000
unsigned long session_id = 0xA90;

