 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;


  delay(5000);
}


void sendEvent() {
  if (doorState == GARAGE_OPEN) {
    door_open = "true";
  } else {
    door_open = "false";
  }

  String roundedVoltage = doubleToString(voltage, 2);

  // create a json document by hand because string support is weak here
  String json = "{\"door_open\":";
  json.concat(door_open);
  json.concat(", \"voltage\":");
  json.concat(roundedVoltage);
  json.concat("}");

  Spark.publish("garage/open", json, 60, PRIVATE);
}

void loop() {
