   r = atoi(rChar);
   g = atoi(gChar);
   b = atoi(bChar);
-
-  if(atoi(mode) == 1) activities();
-  else setColorAndPattern(r, g, b, atoi(pattern));
-
+  if(checkMotionDetection()){
+    if(atoi(mode) == 1) activities();
+    else setColorAndPattern(r, g, b, atoi(pattern));  
+  }
+  if(waitTime(&flashTimeMark2, 60000)){
+    hasMotion = digitalRead(10);
+    if(hasMotion == LOW){
+       wasEnabled = false; 
+    }
+  }
 }
 
 void setColorAndPattern(int r, int g, int b, int pattern){

    }
  }
}
void ideal(int r, int g, int b){
  tintPixels(r,g,b,100);
  if(waitTime(&flashTimeMark, 3000)){

  }
  strip.show();
}

float linearTween (float t, float b, float c, float d) {
  return c*t/d + b;
