I want to show the actual soil moisture from my setup on a thinger.io dashboard. My code is the following:
`
#include SPI.h
#include ESP8266WiFi.h
#include ThingerWifi.h
#define WIFI_SSID "xxxxxxxxxx"
#define WIFI_WPA2_PASSWORD "xxxxxxxxxx"
#define USER_USERNAME "xxxxxxxxxx"
#define DEVICE_ID "xxxxxxxxxx"
#define DEVICE_CREDENTIAL "xxxxxxxxxx"
ThingerWifi thing(USER_USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);
int mosture_Sensor = 0;
void setup() {
Serial.begin(115200);
thing.add_wifi(WIFI_SSID, WIFI_WPA2_PASSWORD);
thing["water"] >> [](pson& out){ out = !analogRead(mosture_Sensor); };
}
void loop() {
thing.handle();
}`
I think there is a problem wih the line thing["water"] >> [](pson& out){ out = !analogRead(mosture_Sensor); };
My dashboard looks like this
This one works fine, i’ll get my treshold.
int soil = analogRead(soilmosture_Sensor); Serial.println(soil);