#define THINGER_SERIAL_DEBUG
#include <ThingerESP32.h>
#define USERNAME "PavalPaval_Thinger"
#define DEVICE_ID "SOIL_MOISTURE"
#define DEVICE_CREDENTIAL "WeatherAPI"
#define SSID "Wokwi-Guest"
#define SSID_PASSWORD ""
ThingerESP32 thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);
int rawvalue=0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(33, INPUT);
thing.add_wifi(SSID,SSID_PASSWORD);
thing["SOIL"] >> [](pson& out)
{
out=rawvalue;
};
}
void loop()
{
// put your main code here, to run repeatedly:
thing.handle();
rawvalue=analogRead(33);
Serial.println(rawvalue);
delay(1000);
}