 
     if(alarmVibrate && ((currentMillis - lastVibration) > MIN_TIME_TO_CHANGE_MOTOR_DIRECTION)){
       lastVibration = currentMillis;
-      lastMotorDirection = !lastMotorDirection;
       
-      if(lastMotorDirection){
-          turnMotor(true, lastMotorDirection);
+      if(lastMotorState == M_CLOCKWISE){
+        
+        lastMotorState = M_PAUSE1;
+        changeMotorState(false, false);
+      
+      } else if(lastMotorState == M_PAUSE1){
+        
+        lastMotorState = M_ANTI_CLOCKWISE;
+        changeMotorState(true, false);
+      
+      } else if(lastMotorState == M_ANTI_CLOCKWISE){
+        
+        lastMotorState = M_PAUSE2;
+         changeMotorState(false, false);
+      
       } else {
-        //Pause motor at regular interval.
-          turnMotor(false, false);
-      }
+        lastMotorState = M_CLOCKWISE;
+        changeMotorState(true, true);
+      }
+
 
     }
     


unsigned long alarmLastStarted;

unsigned long lastVibration;
boolean lastMotorDirection;

unsigned long timeLastPressedLeftButton;
unsigned long timeLastPressedMiddleButton;

  && (alarmVibrate || alarmSound)){
    currentState = ALARM;
    alarmLastStarted = currentMillis;
   
   
     if(alarmVibrate){
        lastMotorState = M_CLOCKWISE;
        motorDriverState(true);
     }
  }

}
