Hello,
I used the api to change the value of a pin with
https://blynk.cloud/external/api/update?token=TOKEN&v0=1
It worked perfectly but since then, the switch that allowed me to change the value of this pin on the dashboard (web and mobile) is disabled. It is grayed out and I can’t click on it.
How can I reactivate it?
Thanks
Hardware : WeMos D1 mini (esp8266)
code:
#define BLYNK_TEMPLATE_ID "my ID"
#define BLYNK_DEVICE_NAME "my NAME"
#define BLYNK_AUTH_TOKEN "my TOKEN"
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "my ssid";
char pass[] = "my password";
BlynkTimer timer;
void updateTimer()
{
Blynk.virtualWrite(V1, digitalRead(D1));
}
void setup()
{
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
pinMode(D5, OUTPUT); //power pin
pinMode(D1 , INPUT_PULLUP); //led pin
digitalWrite(D5, HIGH);
timer.setInterval(1000L, updateTimer);
}
BLYNK_CONNECTED()
{
Blynk.syncVirtual(V0);
}
BLYNK_WRITE(V0)
{
if (param.asInt() == 1)
{
digitalWrite(D5, LOW);
delay(500);
digitalWrite(D5, HIGH);
}
}
void loop()
{
Blynk.run();
timer.run();
}