 float getHumidity() {
   return dht.readHumidity();
 }
-

// Main program loop
void loop() {
  MQTT_Helper.mqttLoop();
  
  checkTempHumid();
  delay(1000); //saves power; we don't need to check often anyways...
  yield();
}

// Initial connection to WiFi
// We wait for 5 seconds to connect, but do not block on the connection.
void connectWifi() {
  Serial.print("Connecting to ");
  Serial.println(SSID);
  WiFi.begin(SSID, PASS);
  delay(5000);
  Serial.println(getTemperature() );
}

//Send temp / humidity update if need be
void checkTempHumid() {
  if (millis() > lastTempHumidSend + TEMP_HUMID_UPDATE_FREQUENCY) {
    

#define PASS ""        // your network password            //
//---------------------------------------------------------//

#define DHTTYPE DHT22     // DHT 22  (AM2302), AM2320, AM2321
const int DHTPin = 4;
bool fahrenheit = true;
DHT dht(DHTPin, DHTTYPE);

#define MAXCHARS  32        // Max chars before a line break
#define ENDMARKER '\n'      // Character that defines the end of a line
char serialChars[MAXCHARS]; // Array to store received data
static byte next_loc = 0;   // Array location for next char

unsigned long lastTempHumidSend = millis();
#define TEMP_HUMID_UPDATE_FREQUENCY 60000

// Initial set up routines
void setup() {
  Serial.begin(9600);
  dht.begin();
  connectWifi();        //Connect to wifi
  MQTT_Helper.setup();
