 
 #define INPUT_PIN 0
 #define DEBOUNCE_TIME_MILLIS 50
+#define SLEEP_TIME_MILLIS 10000
 
 BLEServer* pServer = NULL;
 BLECharacteristic* pCharacteristic = NULL;

bool connected = false;
bool pendingValue = false;


class BLECallback: public BLEServerCallbacks {
    void onConnect(BLEServer* pServer) {
      Serial.println("Connected");
      connected = true;
    };


}


void newValue(){
  pendingValue = true;
  lastEvent = millis();
}


void IRAM_ATTR onPinChanged(){
  newValue();
}

void setup() {
  setCpuFrequencyMhz(80);
  Serial.begin(115200);

  // Set up BLE
