
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

#include #include #include #define DHTPIN 13 #define DHTTYPE DHT const char* ssid = "Wokwi-GUEST"; const char* password = ""; DHT dht(DHTPIN, DHTTYPE); void setup() { Serial.begin(115200); dht.begin(); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) delay(500); Serial.println("WiFi Connected"); } void loop() { float t = dht.readTemperature(); float h = dht.readHumidity(); HTTPClient http; String url = "http://httpbin.org/get?temp=" + String(t) + "&hum=" + String(h); http.begin(url); http.GET(); http.end(); Serial.print("Temp: "); Serial.print(t); Serial.print(" C Humidity: "); Serial.println(h); delay(5000); }