   unsigned int delayVal = random(minSec, maxSec);
   laser.fire(0);
   panTilt.detach();
+  
   unsigned long startTime = millis();
   for(unsigned long i = 0; i < delayVal; i++){
     while(millis() - startTime < 1000){


StuLaser laser(5);



void setup() {

  Serial.begin(BAUD_RATE);

  panTilt.begin();
  laser.begin();

  panTiltX.angle = panTiltX.minAngle;
  panTiltY.angle = panTiltY.minAngle;
  panTilt.updateAngles();


#define DIRECTION_CHANGE_PROBABILITY 15

volatile int sleepState = 0;
const int ledPin =  4;      // the number of the LED pin


void sleepInt(){
  detachInterrupt(0);
  sleepState = 1;
  digitalWrite(ledPin, HIGH);

  
}

void wake(){
  detachInterrupt(0);
 sleepState = 0;

digitalWrite(ledPin, LOW); 
 
}


#define BAUD_RATE 115200

const int switchPin = 3;     // the number of the pushbutton pin


//X Position: lower numbers == Right
