Good morning!
I managed to make the bridge work, but I don’t understand how the various vpins connected to it work.
Which is the meaning of “WidgetBridge bridge1 (V21)” in the sketch emitter if then in the same sketch I can make the bridge with other Vpins (in this case I can read in the receiving sketch V21, V22 and V23) without initializing all the Vpins but only the V21? (which then, even if the associated widget is not added to the app, everything works properly.)
WidgetBridge bridge1(V21); //why V21??
BLYNK_CONNECTED() {
bridge1.setAuthToken("receiver token");
}
void ->
bridge1.virtualWrite(V21, t_buffer1);
bridge1.virtualWrite(V22, t_buffer2);
bridge1.virtualWrite(V23, t_buffer3);
And I don’t understand in the receiver how to set the Vpins … that is, with this receiver sketch I read all the correct data on the serial, perfect, but I don’t understand what we are talking about, whether of the receiver or the emitter:
BLYNK_WRITE(V21) {
Blynk.virtualWrite(V21, param.asFloat ());
sanitaria = param.asFloat ();
Serial.println(sanitaria);
}
BLYNK_WRITE(V22) {
Blynk.virtualWrite(V22, param.asFloat ());
boiler1 = param.asFloat ();
Serial.println(boiler1);
}
BLYNK_WRITE(V23) {
Blynk.virtualWrite(V23, param.asFloat ());
boiler2 = param.asFloat ();
Serial.println(boiler2);
}
And last thing: if I wanted to have two or more emitter and one only receiver, how should I behave? On the variuos emitter I have to change the bridge name (like this code) or I can always use the same name and just change the various Vpins?
BLYNK_CONNECTED() { // in first emitter sketch
bridge1.setAuthToken("receiver token xyz");
}
BLYNK_CONNECTED() { // in second emitter sketch
bridge2.setAuthToken("receiver token xyz");
}
BLYNK_CONNECTED() { // in xxx emitter sketch
bridge3.setAuthToken("receiver token xyz");
}
can someone better explain this aspect to me? thank you