 
     switch(muxChoice){
     case 0: 
-      printf("{\"temperature\": %d, \"time\": ", muxVal);
+      p("{\"temperature\": %d, \"time\": ", muxVal);
       Serial.print(millis());
       Serial.println("}");
       break;
     case 1: 
-      printf("{\"conductance\": %d, \"time\": ", muxVal);
+      p("{\"conductance\": %d, \"time\": ", muxVal);
       Serial.print(millis());
       Serial.println("}");  
       break; 
     case 2: 
-      printf("{\"pressure\": %d, \"time\": ", muxVal);
+      p("{\"pressure\": %d, \"time\": ", muxVal);
       Serial.print(millis());
       Serial.println("}");
       break;

  }
  delay(del);

  Serial.print("], \"capacitor2\": [");
  Serial.print(capacitor2Data[0]);
  for (int i = 1; i< index;i++){
    delay(del);
    Serial.print(", ");
    Serial.print(capacitor2Data[i]);       
  }
  delay(del);
  Serial.print("],");
  Serial.print("\"capacitorIime\": [");
  Serial.print( capacitorTimeData[0]);

  /* dicharge the capacitor  */
  digitalWrite(capacitorChargePin1, LOW);             // set charge pin to  LOW 
  digitalWrite(capacitorChargePin2, LOW);             // set charge pin to  LOW 
}  

void samplePorts() /*sample ports and send over serial according to rates*/ 

