  */
 void sleep() {
   set_sleep_mode(SLEEP_MODE_PWR_DOWN);
-  sleep_enable();
   
   noInterrupts();
+  sleep_enable();
   attachInterrupt(digitalPinToInterrupt(OBSTACLE_SENSOR), onObstacleChanged, CHANGE);
-  interrupts ();
+  interrupts();
   
   sleep_cpu();
 }

 * Main loop
 */
void loop() {
  int obstacleValue = digitalRead(OBSTACLE_SENSOR);
  
  if (lastObstacleValue == HIGH && obstacleValue == LOW) {

 */
void setup() {
  pinMode(BUZZER, OUTPUT);
  pinMode(BUZZER_BATTERY, OUTPUT);
  pinMode(OBSTACLE_SENSOR, INPUT);
  pinMode(OBSTACLE_BATTERY, OUTPUT);

  lastObstacleValue = HIGH;
}
