         tkr_move();
         
         if (light_level < DARK_THRESHOLD) {
-          //goToSleep();
+          //goToSleep(SLEEP_FLAG_DARK);
           //TODO connect PIN_LDR_LEFT to INT0
         }
         
     }
     
+    // Transmit after interval
     if (now - tx_last >= tx_interval) {
         tx_last = now;
         


                              
  sleep_disable();  
  //MCUSR = 0; // clear the reset register 
  
  watchdog_setup(); // watchdog back on
  
  detachInterrupt(0); // No wakeup interupt while awake
  
  power_all_enable();    // power everything back on
  
  ADCSRA = (1 << ADEN); // ADC back on
  
  // Power up the periferals
  digitalWrite(PIN_PERIF_POWER, HIGH); // high = 0n (NPN)
} 

/**

  wdt_reset();
}

void goToSleep(byte flag)
{
  sleep_flag = flag;
  
  // Power down the periferals
  digitalWrite(PIN_PERIF_POWER, HIGH);
  
  cli();
  
  
  // disable ADC
  ADCSRA = 0;  
  
  set_sleep_mode(SLEEP_MODE_PWR_DOWN);

  if (sleep_flag == SLEEP_FLAG_DARK) {
    // Turn off watchdog
    wdt_disable();
    // 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();
