     analogWrite(vibpin,amp);
 
     checkpublish("sl");
-<<<<<<< Updated upstream
     checkpublish("sd");
-=======
->>>>>>> Stashed changes
+    checkpublish("p");
 
 }
 
 void checkpublish(String command) {
 
-<<<<<<< Updated upstream
   if (command=="serial" || command=="sl") {
     Serial.print(analogvalue);
     Serial.print("    ");

    // take average of the last `readperiod` ms of readings and compare to current readings up until 1800, at which point average


    if ((millis() % readperiod)==0) {
        // if it is time to average the values, then average the values
        baseline=currentavg;
        currentavg=analogvalue;
    }
    else {
        // otherwise, update your average log


      lastrecord=millisNow;

    }

  }
