I’ve moved this to a new topic, rather than having it tagged on to the end of a 4 year old topic that is not connected to your issue.
You can only use BLYNK_WRITE with Virtual pins, not Digital pins:
BLYNK_WRITE is a function called every time device gets an update of Virtual Pin value from the server (or app):
To read the received data use:
int value = param.asInt(); // Get value as integer
// The param can contain multiple values, in such case:
int x = param.asInt();
int y = param.asInt();
BLYNK_WRITE can’t be used inside of any loop or function. It’s a standalone function.
Note: For virtual pins with numbers > 127, please use BLYNK_WRITE_DEFAULT() API
If you want to read the value of a digital pin then you would need to do that in exactly the same way as if you weren’t using Blynk - either with an interrupt or by polling the pin with a timer.
In reality, you’d be better using a virtual pin, declaring your digital pin mode in void setup, then changing your digital pin value with a digitalWtite or analogWrite command triggered from your BLYNK_WRITE(vPin) callback.
I’ve also moved your same question asked in a different topic to this new topic.
In future, it’s best to start a new topic and provide all the relevant information, and provide links to what you think are related topics if appropriate, rather than asking the same question in multiple places - that just leads to disjointed responses and conversations split across multiple topics.