 int led1 = D7;
 int door = A0;
 int sensorValue = 0;
+double voltage;
+
+// json variables
+char *door_open;
 
 // let's do some event faking so we don't spam particle.io
 // track the previous state with some ints.  then we'll compare
 // and send an event if it doesn't match the current state.
-
 // set to an invalid state first
 int previousState;
 int doorState;


void sendEvent() {
  if (doorState == GARAGE_OPEN) {
    Spark.publish("garage/open", "true", 60, PRIVATE);
  } else {
    Spark.publish("garage/open", "false", 60, PRIVATE);
  }
}

void loop() {


  delay(5000);
}

String doubleToString(double input,int decimalPlaces){
  if(decimalPlaces!=0){
    String string = String((int)(input*pow(10,decimalPlaces)));
    if(abs(input)<1){
      if(input>0)
        string = "0"+string;
      else if(input<0)
        string = string.substring(0,1)+"0"+string.substring(1);
    }
    return string.substring(0,string.length()-decimalPlaces)+"."+string.substring(string.length()-decimalPlaces);
  }
  else {
    return String((int)input);
  }
}
