 
 //milliseconds to leave the fan on when the target temp has been reached
 //this evacuates the heat or the cold air from vents
-#define END_OF_CYCLE_TIMEOUT 15000
+#define END_OF_CYCLE_TIMEOUT 1000
 elapsedMillis endOfCycleTimer;
 
 //minimum number of milliseconds to leave the heating element on

 currentHumidityString = String(currentHumidityChar);

 //publish readings
 Particle.publish(APP_NAME, "Current temperature: " + currentTempString, 60, PRIVATE);
 Particle.publish(APP_NAME, "Current humidity: " + currentHumidityString, 60, PRIVATE);

 return 0;


#include "FiniteStateMachine.h"
#define APP_NAME "Thermostat"

String VERSION = "Version 0.10";
/*******************************************************************************
 * changes in version 0.09:
       * reorganized code to group functions
       * added minimum time to protect on-off on the fan and the heating element
          in function heatingUpdateFunction()
 * changes in version 0.10:
       * added temperatureDifference to fix DHT measurements with existing thermostat
       * reduced END_OF_CYCLE_TIMEOUT to one sec since the HVAC controller
          takes care of waiting of evacuating the heat/cold from the vents
*******************************************************************************/

/*******************************************************************************
