0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

How to read virtual pin's value(I NEED Blynk.virtualRead)

Posted at

There is no method like 'Blynk.virtualRead' in Blynk. So I used global variable and Blynk.synkAll() method.

int value;

BLYNK_WRITE(V10) 
{
  value = param.asInt(); 
}

BLYNK_CONNECTED() {
    Blynk.syncAll();
}

BLYNK_WRITE(V0) 
{
  int pinData = param.asInt(); 
  Serial.println(pinData);
  if(pinData == 1) {
    Serial.println(value);
  }
}

It works because when BLYNK_WRITE() event happens when Blynk.syncAll() or Blynk.syncVirtual(vPin) is called.

docs.blynk.cc/#blynk-firmware-blynktimer-blynksyncall

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?