 
 #define DEBUG
 #include "utils.h"
-
 
 SoftwareSerial XBee(2, 4); // RX, TX
 

  pressed = false;
  released = false;
  last_release_time = 0;
}

// should I abstract out the click event and then implement advanced ones?
// well, so the question now is how you detect tap when you have fingers on the slider?
// this is different from click, double click


gesture_t sliderEvent(int *delta, int counts) {
  // all related events are detected here
  gesture_t returnV = gNONE; 
  softpotReading = analogRead(softpotPin);
  /* DEBUG_PRINT("   gStart_time: "); */
  /* DEBUG_PRINT(gStart_time); */
  /* DEBUG_PRINT("   clicks: "); */
  /* DEBUG_PRINT(clicks); */
  /* DEBUG_PRINT("   gState: "); */
  /* DEBUG_PRINT(gState); */
  /* DEBUG_PRINT("   Softpot Reading: "); */
  /* DEBUG_PRINTLN(softpotReading); */

  if (clicks > 0 && (millis() - gStart_time) > gResolution) {
    gState = gIDLE;
    gStart_time = 0;
    if (softpotReading < SOFTPOT_THREASHOLD) {
      if (clicks == 1) {
	returnV = gTAP;
      }
      else if (clicks == 2) {

    clicks = 0;
    if (softpotReading < SOFTPOT_THREASHOLD) {
      gState = gPRESS;
      gStart_time = millis();
      softpotInitV = softpotReading;
      return gHOVER;
    }
    break;
  case gPRESS:
    if (softpotReading < SOFTPOT_THREASHOLD) {
      delta_threshold = SOFTPOT_DELTA_THREASHOLD;
      *delta = 0;
