 	motion.init(5000);
 
 	timer.setInterval( 110,  &detectMotion);
-	timer.setInterval( 150,  &detectSonar);
 	timer.setInterval( 100,  &detectButtonPressed);
 	timer.setInterval(1000,  &switchPower);
+	timer.setInterval( 500,  &showLed);
 }
 
 


void logCurrentState() {

	printf("Active? %s | Button %s | Motion? %s | Sonar? %s (%4d/%4d)",
			(state.active ? "YES" : " NO"),
			(state.buttonPressed ? " ON" : "OFF"),
			(state.motionDetected ? "YES" : " NO"),
			(state.sonarDetected  ? "YES" : " NO"),
				sonar.getDistance(),
				sonar.getDistanceThreshold()
  			);

	if (state.active && state.buttonPressed && !state.motionDetected && !state.sonarDetected) {
		long timeLeft = INACTIVITY_THRESHOLD - (millis() - state.lastActivityAt) / 1000;
		if (timeLeft < 0) timeLeft = 0;
		printf(" | Time Remaining? (%d/%d) sec ",

	memset(&state, 0x0, sizeof(StateStruct));

	pinMode(pinSwitch, OUTPUT);
	pinMode(pinLed, OUTPUT);
	pinMode(pinButton, INPUT);
	pinMode(pinIRInput, INPUT);

