First of all, each BLYNK_WRITE(vPin) callback function is handled individually, so you can’t have this:
I’d suggest you declare two GLOBAL variables, lets call them widget_a and widget_b as you haven’t told us what the widget types or functionality are.
We’d probably need another one for the result, so we’ll call this math_result
Then, when one of the BLYNK_WRITE(vPin) callbacks are triggered, you store the incoming value to the corresponding global; variable.
You then have a number of options - do the maths in each of the two BLYNK_WRITE(vPin) calbacks, or (and this is the neater option) put the maths in a single separate function and call it from your BLYNK_WRITE(vPin) callbacks.
The code could look something like this…
int widget_a;
int widget_b;
int math_result;
BLYNK_WRITE(V1)
{
widget_a = param.asint();
do_the_math();
}
BLYNK_WRITE(V2)
{
widget_b = param.asint();
do_the_math();
}
void do_the_math()
{
math_result = widget_a / widget_b;
Serial.print("The result is.. ");
Serial.println(math_result);
// maybe write the result to your servo here?...
}
I do not know how to thank you🥺.
I spend a lot of time to write this specific code. But I do not know coding that much. You could not realise how much your Knowledge going to help me🥺.
I will inform you, if I get any problem later.
I hope I Will get more help from you later. Thank you so much Sir…