       }
   }
   lastObstacleValue = obstacleValue;
-  
+
   sleep();
 }
 

#include <avr/sleep.h>

const int OBSTACLE_SENSOR = 2;
const int BUZZER = 3;
const int SOUND_DURATION = 40;
const int RANDOM_ERROR_COUNT = 20;
int lastObstacleValue;

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