Where do I set Read frequency on a widget?

I am switching from the “old” blynk to the new one and trying to get familiar.

I am using the examples sketch generated here:
https://examples.blynk.cc/?board=ESP8266&shield=ESP8266%20WiFi&example=GettingStarted%2FPushDataOnRequest

In the comments it says:

      Project setup in the app:
        Value Display widget attached to V5. Set any reading
        frequency (i.e. 1 second)

and...
    // This function tells Arduino what to do if there is a Widget
    // which is requesting data for Virtual Pin (5)
    BLYNK_READ(PIN_UPTIME)
    {
      // This command writes Arduino's uptime in seconds to Virtual Pin (5)
      Blynk.virtualWrite(PIN_UPTIME, millis() / 1000);
    }
```cpp

In the previous app version, I recall begin able to set the read frequency of a label widget.  But I am not seeing that anywhere now and I am not sure how to set it.  

I have been working through the docs to no avail looking for info on BLYNK_READ, but I am starting to think maybe it has been deprecated and instead I need to specify this in BlynkTimer?

Thanks for any thoughts!



Details:
• Hardware model + communication type. Adafruit Huzzah ESP8266 + WiFi
• Smartphone OS -> iOS 15.5
• Blynk server 
• Blynk Library version -> 1.1.0

I’m not sure, but I don’t think the BLYNK_READ function works with the new blynk.
You should use BLYNK_WRITE function instead.

Thanks @John93

In the example sketch “PushDataOnRequest” that comes with the new library and is in the code generator, they use:

// This function tells Arduino what to do if there is a Widget
// which is requesting data for Virtual Pin (5)
BLYNK_READ(PIN_UPTIME)
{
  // This command writes Arduino's uptime in seconds to Virtual Pin (5)
  Blynk.virtualWrite(PIN_UPTIME, millis() / 1000);
}

I guess BLYNK_READ must be out then. If that is the case, I hope they are able to remove this example sketch from the library and from the code generator examples.

I think it’s one of a long list of minor tweaks and adjustments that need to be made to the examples and the documentation to remove legacy stuff and add information that’s missing for IoT stuff.

Unfortunately, many Blynk staff have other priorities at the moment, because they live in the Ukraine.

Pete.

2 Likes

That makes a ton of sense. Thanks for all help here, I think I am on the right track now.