 {
   pinMode(GREEN_PIN, INPUT);  // saves som extra uA
   pinMode(RED_PIN, INPUT); // saves som extra uA
+  pinMode(POWER_SWITCH_PIN, INPUT); // saves som extra uA
   ADCSRA &= ~(1<<ADEN); //Disable ADC, saves ~230uA
   setup_watchdog(8); //Setup watchdog to go off after 8sec
   sleep_mode(); //Go to sleep!
   ADCSRA |= (1<<ADEN); //Enable ADC
   pinMode(GREEN_PIN, OUTPUT);  // saves som extra uA
   pinMode(RED_PIN, OUTPUT); // saves som extra uA
+  pinMode(POWER_SWITCH_PIN, OUTPUT); // saves som extra uA
 }
 
 //This runs each time the watch dog wakes us up from sleep

      }
    } else {
      // Not much voltage left, flash green pin 1s.
      digitalWrite(RED_PIN, LOW);
      for (int i=0; i<5; i++) {
        digitalWrite(GREEN_PIN, HIGH);

    vcc = readVcc();
    if (vcc >= 3900) { 
      // Measured at vcc=3.7V, plenty of voltage
      digitalWrite(POWER_SWITCH_PIN, HIGH);
      digitalWrite(GREEN_PIN, HIGH);
      digitalWrite(RED_PIN, LOW);
      delay(1000); // delay so we are not checking vcc all the time
      digitalWrite(GREEN_PIN, LOW);
    } else if (vcc <= 3400) {
      // Measured at vcc<=3.3V, voltage is gone, flash fast red pin 1s
      // Don't turn on POWER_SWITCH_PIN, no voltage left
      digitalWrite(GREEN_PIN, LOW);
      for (int i=0; i<5; i++) {
        digitalWrite(RED_PIN, HIGH);
