Particle photon Bridge

Hi all , I am currently using Particle Photon and an iPhone for a project. For my final feature, I would like to implement the widget of Bridge. However, there seem to be no tutorials or guides anywhere online. Even though there is the example sketch , I am still unsure of what are the next necessary steps to fully utilize Bridge. Hopefully by posting this, there would be some help within the community.

Thank you

Bridge is used to enable communication between two (or more) hardware devices, and use of the app widget is unnecessary (in fact, it doesn’t do anything).

The official documentation is here:

and there are many discussions and examples of how to use Bridge in one-way, bi-directional and multiple device situations if you use the search facility of this forum.

Pete.

Hi Pete, thank you for your prompt response. I have read the documentation however am still unsure on certain areas. For example, it stated that code must be written for Device B but I am uncertain of what codes need to be written.

What did you find when you searched the forum for examples?

Pete.

If you have Blynk code on both devices you simply.
Note!!! this works with Arduino, no idea about Photon.

1 declare a name and set to an unused V pin
WidgetBridge bridge1(V1);

2- in setup or Blynk connected
BLYNK_CONNECTED() {
bridge1.setAuthToken(“OtherAuthToken”);

3- write to that devices V pins just like this… bridge1.virtualWrite(V5, 0); // Sends 0 value

Hi DaveBlynk, thank you for your response. I have previously completed all the mentioned steps however, I am still unclear of how to view any forms of output. The code works fine when complied.However after compiling, I was confused to as how bridge works. Can i remotely control my friends LED or their controls on the app thru my phone?

Mostly arduino posts however particle photon is quite different. After putting in the necessary codes, I wasnt sure of what to do next.

The Bridge process is device agnostic, as it uses virtual pins.

You use one device to send data on a virtual pin to device 2.
Device 2 has a BLYNK_WRITE(vPin) callback function which is linked to the virtual pin that the data is being sent on. Every time data is received, the BLYNK_WRITE(vPin) function will execute.
What you do with this data once it arrives is up to you, hence the assertion to…

Keep in mind that when performing virtualWrite with Bridge, second board will need to process the incoming command.

Pete.

Hmm i see thanks Pete