#include <ThingSpeak.h>
#include <WiFi.h>
#include <Wire.h>
WiFiClient client;
char ssid[]="Wokwi-GUEST";
char password[]="";
unsigned const long channelid=2510219;
const int field=2;
const char *apiKey="D1Q5TWC2WQ96UB3Y";
const int t=35;
void setup() {
WiFi.begin(ssid,password);
WiFi.mode(WIFI_STA);
ThingSpeak.begin(client);
Serial.begin(115200);
Serial.println("Hello, ESP32!");
}
void loop() {
float temp=analogRead(t);
temp*=3;
temp/=10;
Serial.println(temp);
ThingSpeak.writeField(channelid,field,temp,apiKey);
delay(2000);
}