How to pull multiple blynk wiget pin value from esp8266 using only one blynk button

Dear Everyone

Is it possible to send multiple blynk PIN value to esp8266 using a Save, submit button on Blynk app?

For an example. , On blynk app I have 2 textbox wiget vpin10 and vpin11, and after entering my value to them, i click “Save” button, I want to send the value of those vpin back to esp8266.

Thanks

If the “save” button triggered the commands Blynk.syncVirtual(V10) and Blynk.syncVirtual(V11 the you could get it to work.

Pete.

Dear Pete
i wrote this, when the
button (vpin127) pressed BLYNK_WRITE(V127) fire, but it doesnt call to BLYNK_WRITE(V10) and BLYNK_WRITE(V11) method. Can you help ?

BLYNK_WRITE(V10) {
 
//code
}

BLYNK_WRITE(V11) {
 
//code
}


BLYNK_WRITE(V127) {
  
  Blynk.syncVirtual(V10);
  Blynk.syncVirtual(V11);
}

@Anthony_Chen please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Pete.

1 Like

Thanks Pete
I did it, now code displayed

It looks like it should work, but without seeing the full code and understanding what you are seeing when the various widget buttons are pressed and how you have your app configured it’s difficult to say why it’s not working.

Pete.

Dear Pete

When i pressed the button (vpin127), i can see serial print “Saving” and “Saving Done”, but serial not print “trace1” and “trace2” , just like the method not call

V10 and V11 on blynk app are text input widget, i enter some int value like 5, 10 to test


BLYNK_WRITE(V10) {
  
 
  Serial.println("trace 1");

}

BLYNK_WRITE(V11) {
   Serial.println("trace 2");

}

BLYNK_WRITE(V127) {

  int pinValue = param.asInt();
  if (pinValue == 1)
  {
    Serial.println("Saving");
    Blynk.syncVirtual(V10);

    Blynk.syncVirtual(V11);

    

  
    Serial.println("Saving Done");
  }
}

Thanks Pete

IDK why but after change vpin 10 and 11 widget on blynk app to numeric input, the value updated ok

Regards

1 Like