#include <DHT.h> // Including library for dht
#include <ESP32WiFi.h>
string apiKey = "Write API KEY"; // enter your write API key from ThingSpeak
const char * ssid = "SSID"; // replace with your wifi ssid and wpa2 key
const char * pass ="xxxxxxxxxxxxxxx"
const char * server ="api.thingspeak.com";
#define dhtpin 5 // pin where the dht11 is connected PIN D1 correspond au GPI05
DHT dht (DHTPIN ,DHT11);
// crèation instance client
WIFIClient client;
void setup()
{
Serial.begin(115200);
delay(100);
dht.begin();
// connect to WIFI network
Serial.println("connecting to ");
Serial.println(ssid);
Wifi.bigin(ssid, pass);
while(Wifi.status()!=WL_CONNECTED)
{
delay(500);
Serial.println(".");
}
Serial.println("");
Serial.println("Wifi connected");
}