  * Main loop
  */
 void loop() {
+  digitalWrite(OBSTACLE_BATTERY, 255);
+  digitalWrite(BUZZER_BATTERY, 255);
   int obstacleValue = digitalRead(OBSTACLE_SENSOR);
   
   if (lastObstacleValue == HIGH && obstacleValue == LOW) {

      }
  }
  lastObstacleValue = obstacleValue;
  
  sleep();
}


#include <avr/sleep.h>

const int OBSTACLE_SENSOR = 2;
const int OBSTACLE_BATTERY = 5;
const int BUZZER = 3;
const int BUZZER_BATTERY = 6;
const int SOUND_DURATION = 40;
const int RANDOM_ERROR_COUNT = 20;
int lastObstacleValue;
