 const int kSwitchGnd = D6;
 const int kSwitchSense = D7;
 
-const int debounceDelay = 50;
+const int debounceDelay = 5;
 const int doubleClickDelay = 500;
 
 int lastButtonStateChangeTime = 0;

    keepLEDColor = keepLEDColor - 1;
  } else {
    if (kDebugLED) {
      if (motionState == HIGH_MOTION) {
        RGB.color(0, 0, 255);
      } else {
        int b = (int) (((float)highReads / (float)reallyOnThreshold) * 255);
        RGB.color(b, 0, 0);
      }
    } else {
      RGB.color(0, 0, 0);

const int kVcc = D2;

// tracks how many PIR reads have been high in a row
// 10 is too sensitive, 20 works ok
const int onThreshold = 15;
const int maxOn = 180;
int highReads = 0;

int motionState = 0;
const int NO_MOTION = 0;
const int MOTION = 1;

// used to temporarily set LED to a color
int keepLEDColor = 0;
