BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       👉 SKETCH BUILDER

Automatic scheduler. Time Input Widgets

hello,i have a issue with new blynk time input widget. I create a virtual pin in data stream as string.but the problem is how i link this with my digital pins. previous version of blynk is too easy and this version not familiar with me

Check this
https://docs.blynk.io/en/getting-started/using-virtual-pins-to-control-physical-devices#virtual-pin-datastream

2 Likes

my problem is timer input widget support only sring data type and how i link with vertual or data pin? ( i need to time control my relay board)

You can try automation, which is a no coding solution.
https://docs.blynk.io/en/concepts/automations

The Time Input widget uses a string datastream to provide an array of data:

  • [0] The start time (in seconds after midnight) - e.g 25620 would mean 07:07 hrs
  • [1] The end time (also in seconds after midnight) - e.g 39780 would mean 11:02 hrs
  • [2] The timezone - e.g Europe/London
  • [3] The days of the week that are selected - e.g Mon, Wed, Fri & Sun
  • [4] The timezone offset in minutes from GMT

To use this information you’ll need to get the current date/time, and usually this would be UNIX time, which gives the elapsed time in seconds or milliseconds since 1st January 1970. You’d then use the time.h library to give you the date/time/day of the week etc, and probably a timezone library too.

With this information, you can calculate if the item you are controlling should be on or off at this moment in time, and use a digital.Write command to set the GPIO pin HIGH or LOW as required.

If your C++ programming skills aren’t up to handling this then I’d suggest that you use Automations instead.

Pete.

hello , thanks for your reply.i early done this blynk old version but this is looks like complex. could you kindly upload a sample code to this please.i think its better to understand.

thanks again

Pete.