I hooked up ESP12F and was able to pass the data to the cloud (DHT11)
and today I can’t control the turning on led
Maybe I wrongly named pin?
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <ThingerWifi.h>
ThingerWifi thing("scratch_book", "ESP12F", "*******");
int pin = 13; // select the input pin
void setup() {
thing.add_wifi("********", "**********");
thing["led"] << [](pson& in){
if(in.is_empty()){
in = (bool) digitalRead(pin);
}
else{
digitalWrite(pin, in ? HIGH : LOW);
}
};
}
void loop() {
thing.handle();
}