 const char* ssid = "WongIoT";
 const char* password = "nodemcu888";
 
-DHT dht(D7, DHT11,15); //Using D7 as receive pin, snesor type is DHT11, byte count is 15
-
 WiFiClient  client;
+SimpleDHT11 dht11;
 
 void setup() {
   Serial.begin(BAUDRATE);

#include <SoftwareSerial.h>
#include <ESP8266WiFi.h>
#include "ThingSpeak.h"
#include "DHT.h"
#include "Server.h"

  Serial.printf("Illuminance (Brightness) : %d Lux\n", illuminance);
  Serial.printf("Water level (Millimeter) : %d mm\n\n", waterLevel);

  Serial.println("Writting data to ThingSpeak......");
  ThingSpeak.setField(1, (int)temperature);
  ThingSpeak.setField(2, (int)humidity);
  ThingSpeak.setField(3, illuminance);
  ThingSpeak.setField(4, waterLevel);
  ThingSpeak.writeFields(monitorChannel, monitorWrite);  

  Serial.println("Reading brightness control from ThingSpeak......");
  int ledBrightness = ThingSpeak.readFloatField(operationChannel, 1);
  
  Serial.printf("Set LedBrightness to     : %d Lux\n", ledBrightness);
  ledBrightness = map(ledBrightness, 0, 35000, 0, 255);
  analogWrite(LED, ledBrightness);

