   pinMode(led1, OUTPUT);
   pinMode(door, INPUT);
 
-  Spark.variable("garage/voltage", &sensorValue, INT);
+  Spark.variable("garage/voltage", &sensorValue, DOUBLE);
+  Spark.variable("garage/door_open", &door_open, STRING);
   readDoorSensor();
   previousState = doorState;
 }
 
 void readDoorSensor() {
   sensorValue = analogRead(door);
-  float voltage = ((sensorValue * 3.3) / 4095);
+  voltage = ((sensorValue * 3.3) / 4095);
 
   // 3 is a magic number here, coresponds to the voltate I saw with Serial.println()
   if (voltage > 3) {


  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() {
