#include <ThingSpeak.h>
#include <WiFi.h>
const char* ssid = "Wokwi-GUEST";
const char* password = "";
char server [] = "api.thingspeak.com";
unsigned long channelID = 2485975;
char readAPIKey [] = "RLLY8PLM1JMVSGWI";
unsigned int dataFieldOne = 1;
unsigned int dataFieldTwo = 2;
float data1;
float data2;
WiFiClient client;
const int led = 15;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(led, OUTPUT);
WiFi.begin(ssid, password);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serila.println("Connected");
ThingSpeak.begin(client);
delay(1000);
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}