#define ledCozinha 23
#define ledSala 22
#define ledBanheiro 21
bool estadoLedCozinha = 1;
bool estadoLedSala = 1;
bool estadoLedBanheiro = 1;
#include <WiFi.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
const char* ssid = "Wokwi-GUEST";
const char* password = "";
const String url = "https://romuulogoncalves.github.io/EPA-2022/";
void setup() {
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(ledCozinha, OUTPUT);
pinMode(ledSala, OUTPUT);
pinMode(ledBanheiro, OUTPUT);
while (WiFi.status() != WL_CONNECTED) {
delay(100);
Serial.print(".");
}
}
void loop() {
HTTPClient http;
http.useHTTP10(true);
http.begin(url);
http.GET();
String result = http.getString();
Serial.println(result);
if (result 1 = "") {
digitalWrite(ledCozinha, HIGH);
}
}