 byte ledState = HIGH;
 byte msgId = 0;
 
+byte sleep_flag;
 
 Servo servo_horz;
 

  wdt_reset();
}

void goToSleep()
{
  // Power down the periferals
  digitalWrite(PIN_PERIF_POWER, LOW);
  
  cli();
  
  // Turn off watchdog
  wdt_disable();
  
  // disable ADC
  ADCSRA = 0;  
  
  set_sleep_mode(SLEEP_MODE_PWR_DOWN);

  // Attach the external interupt to the LDR.
  attachInterrupt(0, wakeUp, HIGH);

  power_all_disable();  // power off ADC, Timer 0 and 1, serial interface
  sleep_enable();

    pinMode(LED_DEBUG, OUTPUT);     
    pinMode(PIN_TX, OUTPUT); 
    
    pinMode(PIN_PERIF_POWER, OUTPUT);
    digitalWrite(PIN_PERIF_POWER, LOW); // low = 0n (PNP)
    
    pinMode(SERVO_PIN_HORZ_POWER, OUTPUT); 
    digitalWrite(SERVO_PIN_HORZ_POWER, LOW); // low = 0n (PNP)
