Hi averyone, and Thank you for any help you can offer
This is my issue:
- I have an ESP8266 dev board (NodeMCU v3) and i’m testing builtin led control, using on/off state widget.
All is working fine (with thing[“led”] << invertedDigitalPin(LED_BUILTIN) ) , but when the board is reset, the led is always ON, no matter the state of control button in widget. - So, is there any way of “retained control” of this widget?, beacause I need the board “remember” the state of the control button.
I apreciate any kindly support
Code:
#define THINGER_SERIAL_DEBUG
#include <ThingerESP8266.h>
#include “arduino_secrets.h”
#define LED_BUILTIN 2
ThingerESP8266 thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);
void setup() {
// open serial for monitoring
Serial.begin(115200);
// set builtin led as output
pinMode(LED_BUILTIN, OUTPUT);
// add WiFi credentials
thing.add_wifi(SSID, SSID_PASSWORD);
// digital pin control example (i.e. turning on/off a light, a relay, configuring a parameter, etc)
thing[“Led”] << invertedDigitalPin(LED_BUILTIN);
thing[“Led”] >> outputValue(digitalRead(LED_BUILTIN));
// resource output example (i.e. reading a sensor value)
thing[“millis”] >> outputValue(millis());
// more details at DEVICES - Thinger.io Documentation
}
void loop() {
thing.handle();
}