 
 int photoPin = A5;           // photoresistor pin
 int powerPin = A0;
+int readoutTimeIntervalMins = 1;   // perform a readout every given minutes
+
+long lastReadoutTime = 0;    // timestamp of the last readout
 float lux, lmin, lmax;
 int day = 0;
+bool connecting = false;
 
 
 void setup() {
-  Time.zone(+2);     // set your time zone if you wish a local time display
   pinMode(photoPin, INPUT);     // prepare the photoresistor
   pinMode(powerPin, OUTPUT);
   digitalWrite(powerPin, HIGH);



void loop() {
  doReadout(true);
  delay(2000);
}

  String sl(lux, 3);
  String slmin(lmin, 3);
  String slmax(lmax, 3);
  // generate the payload
  String payload = "{lux: " + sl +
      // also publish daily max and min values when button pressed
      (button ? ", lmin: " + slmin + ", lmax: " + slmax : "") +
      "}";
  // publish data
  if(!Particle.publish("luxdata", payload, PRIVATE, WITH_ACK)) {
    return -1;
  }
  return 0;
