Need help for Time Input widget

Hello.
Please show a sample code to control the virtual pin with the Time Input widget .
For example I need to turn on and off a relay that hangs on the v0 at a certain time.
Thank you in advance

Hello. Have you check examples? -
https://examples.blynk.cc/?board=ESP8266&shield=ESP8266%20WiFi&example=Widgets%2FTimeInput%2FSimpleTimeInput
https://examples.blynk.cc/?board=ESP8266&shield=ESP8266%20WiFi&example=Widgets%2FTimeInput%2FAdvancedTimeInput

Yes, but I don’t understand how to bind a digital pin to a virtual pin in this case.
here’s my code

#define BLYNK_PRINT Serial
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#define RELE D7
bool rele;

char auth[] = "";

char ssid[] = "";
char pass[] = "";

void setup()
{
  Serial.begin(115200); 
  Blynk.begin(auth, ssid, pass);
  pinMode(RELE, OUTPUT);
}

BLYNK_WRITE(V0)
{
  long startTimeInSecs = param[0].asLong();
  Serial.println(startTimeInSecs);
  Serial.println();
  rele = param.asInt();
  digitalWrite(RELE, rele);
}
void loop()
{
  Blynk.run(); 
  timer.run();
}

That’s it. But of course it depends on what yuo trying to do here. Probably you need pass HIGH/LOW and not param.asInt() to your rele.

like this?

BLYNK_WRITE(V1)
{
long startTimeInSecs = param[0].asLong();
Serial.println(startTimeInSecs);
Serial.println();
digitalWrite(RELE, LOW); //relay works at low signal
}

but it does’nt still work.
help me please, I just don’t know it at all yet.

With effort, “In Time” :stuck_out_tongue_winking_eye: you will.

Meanwhile, that is NOT how you use the Time Input Widget… you need to take in the settings it provides, then with lots of code and logic in a timed loop, you constantly compare “now” with the various start/stop/etc. time settings input from the widget, and when conditions are correct, do something.

READ this topic thoroughly and try for yourself… but ask questions about your issue here, NOT there.

Now if you simply want to toggle pins with a timer, use the Eventor Widget and it’s internal timer, or even try the very basic Timer Widget. ← Clickable links

Thanks! I was helped by the code from your example.
I also was not clear where the Time Input is supposed to take time and he must know when to run :smile:
By the way, my ios app doesn’t have an Eventor Widget

OK, iOS App might not have it yet.