 // This #include statement was automatically added by the Particle IDE.
 #include "Adafruit_DHT/Adafruit_DHT.h"
 
-// Connect pin 1 (on the left) of the sensor to +5V
-// Connect pin 2 of the sensor to whatever your DHTPIN is
-// Connect pin 4 (on the right) of the sensor to GROUND
-// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor
-
-int dhtPin = 2;           // DHT sensor
-int ledPin = D7;          // Internal LED
-int pushButtonPin = D5;   // Push button
-int readoutTimeIntervalMin = 3;   // perform a readout every given minutes
+int dhtPin = 2;                        // DHT sensor pin
+int pushButtonPin = D5;                // Push button pin
+int readoutTimeIntervalMin = 3;        // perform a readout every given minutes
+String thingName = "glp_photon_vth";   // thing name for Dweeter
 
 DHT dht(dhtPin, DHT22);
 HttpClient http;

};
http_request_t request;
http_response_t response;
int t = readoutTimeIntervalMin*5*60;    // time counter: force a readout at startup

void setup() {
  Time.zone(+1);
 	dht.begin();
  pinMode(ledPin, OUTPUT);               // D7 pin is output
  pinMode(pushButtonPin, INPUT_PULLUP);  // input with an internal pull-up resistor
}


  else {
    Particle.publish("STATE", "Periodic data readout");
  }
  // post to dweet: follow at http://dweet.io/follow/THINGNAME
 	request.hostname = "dweet.io";
  request.port = 80;
  request.path = "/dweet/for/" + thingName +
      "?temp=" + st + "&humidity=" + sh + "&time=" + Time.local();
 	Particle.publish("DWEET", request.path);
  http.get(request, response, headers);
  //Particle.publish("DEBUG",response.status);
  Particle.publish("DWEET", response.body);
}

void loop() {
