 void onPinChanged(){
   Serial.println("On pin changed");
   if(debounce() == true){
+    // Wait until value has estabilized
+    delay((unsigned long)DEBOUNCE_TIME_MICROS/1000);
     if(connected == true){
       // Read input and store
       uint8_t value =  0;

      Serial.println("Notification sent");
    }
    else{
      Serial.println("Interrupted but not connected");
    }
  }
}


/** Debounce
 *  
 *  Returns true if this is the first reading after a switch.
 */
bool debounce(){
  unsigned long readTime = micros();
