Read Time Input without trigger...?

Hi All…!!!

I’m not new in IT, but I’m really new with Blynk… :smiley:

I want to read the value in a Time Input (just HH:MM) into a variable, but not only when the value is changed, I want to read at least at program start…

How can I force it to read that data…?

Sorry for such a newbie question, geez, I can find that simple answer…!!!

Thanks…!!!
Javier.

Hello. The Time Input “transmits” the input info when you enter it and press OK… it is then up to code in the sketch to take that vPin info (in UI time format) and separate out the time elements and make use of it at a later “time” as required.

However, there is an example shown in the Docs that indicates you can pull that vPin value at the beginning of the sketch as well… possibly other times? I haven’t played with it that much to be sure.

Hi Gunner…!

I saw examples,like that, but they are updating the widget from the program with a value…
I just want to read what is in the widget, without modification.

To be clear, and resuming, my objective is simple: Run a motor at the time in the widget.

I’m using a NodeMCU… if the module is restarted, how can I recover the already programmed time ?

Thanks…!

See what I already referenced… look for the words: //as soon as connected update TimeInput widget state

As long as you haven’t changed the Time Input data, it will read what is already there.

OK, after rereading that file again… now I am actually unsure… It almost looks like it is SETTING the time in the widget, which doesn’t make sense… it is a Time Input widget, no reason for the sketch to set it, only to get the info right back again?

Maybe someone else who has had more experience with it will chime in abut it.

Meanwhile I guess you could also try runming a Blynk.syncVirtual(vPin) command in a BLYNK_APP_CONNECTED() function.

Y tested that (Blynk.syncVirtual(vPin)), but no luck… :-/

Ok… seems I was doing something wrong/incomplete…

Blynk.syncVirtual(vPin) now worked…!!!

When executed (put it in “void Setup()”), triggers the code in routine BLYNK_WRITE(vPin) and there is the variable loaded…

Thanks…:!!! :smiley:

1 Like