   }
 }
 
+int checkMotionDetection(){
+   if(waitTime(&flashTimeMark, 1000)){
+     hasMotion = digitalRead(10);
+     if (hasMotion == HIGH) {
+        wasEnabled = true;
+        return wasEnabled; 
+     }
+   }
+   return wasEnabled; 
+}
 void off(int r, int g, int b){
   tintPixels(r, g, b, 0);  
 }

  r = atoi(rChar);
  g = atoi(gChar);
  b = atoi(bChar);

  if(atoi(mode) == 1) activities();
  else setColorAndPattern(r, g, b, atoi(pattern));

}

void setColorAndPattern(int r, int g, int b, int pattern){

#include <Bridge.h>
#include <HttpClient.h>
#include <math.h>
#define PIN 6
int pirState = LOW;
#define TIMECTL_MAXTICKS  4294967295L
#define TIMECTL_INIT      0
long time;
