-
-#include <Wire.h>
-#include "rgb_lcd.h"
-
+#include <Wire.h> // wire library is used with the lcd display
+#include "rgb_lcd.h" //declaration of the lcd
 rgb_lcd lcd;
-
-
-#include <DHT.h>        //Attention: For new  DHT11 version  library you will need the Adafruit_Sensor library
-                        //Download from here: https://github.com/adafruit/Adafruit_Sensor
-
-
-
-//Attention: For new  DHT11 version  libraries you will need the Adafruit_Sensor library
-//Download from here:https://github.com/adafruit/Adafruit_Sensor
-//and install to Arduino software
-
-#define DHTPIN 6                // Connect the signal pin of DHT11 sensor to digital pin 5
-#define DHTTYPE DHT11 
-DHT dht(DHTPIN, DHTTYPE);
+#include <DHT.h>             //got this from here: https://github.com/adafruit/Adafruit_Sensor
+#define DHTPIN 6                // Connect the signal pin of DHT11 sensor to digital pin 6
+#define DHTTYPE DHT11         // gloabal declaration of the DHT11 module and type 
+DHT dht(DHTPIN, DHTTYPE);     // initialization if the DHT pin and the type
 
 
 String apiKey = "YFQJHA81LPGWGYBI";     // replace with your channel's thingspeak WRITE API key

           thingSpeakWrite(t,h);                                      // Write values to thingspeak
      }
  
    
  // thingspeak needs 15 sec delay between updates,     
 
  
    // set the cursor to column 0, line 1
    // (note: line 1 is the second row, since counting begins with 0):
    lcd.setCursor(0, 1);
    // print the number of seconds since reset:

    // Print a message to the LCD.
    
     //lcd.print("Temperature is", t "Humidity is", h );
    lcd.print("T="+String(t)+ "\n");
    lcd.print("H="+String(h));

   
 delay(20000);  
}



  dht.begin();          // Start DHT sensor
  
  Serial1.begin(115200);  // enable software serial
                         
  showResponse(1000);
  
  Serial1.println("AT+RST");         // reset esp8266
