BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

How to compare value two value in blynk app

I am reading two sensor value by esp8266 and uploading on blynk app . I want to compare that value if the value is not same then I should get notification that value is not equal can it be possible please help me to figure it out.

Thanks

You should compare the values using code on your ESP8266 and when the desired condition is met then trigger a notification from the ESP8266.

Pete.

I am using 2 esp8266 from that I am uploading data to blynk so I am unable to compare in code

You can use the Blynk BRIDGE widget (look in the examples) so send the value from one ESP8266 to the other one. Then on the ESP8266 that has both values, do the comparison and determine the action.
billd

can i compare analog values?

Yes.
Although the signals sent to the ESPs may be analogue when they come from the sensors, the first thing that happens is that they are converted to digital values that the ESP can handle using the onboard ADC. This means that they will either be held as floating point or integer values, either of which can be compared in code.

Pete.

thanks sir

can you please provide any example code for this .

There’s an example in the SketchBuilder, but it’s not very intuitive:
https://examples.blynk.cc/?board=ESP8266&shield=ESP8266%20WiFi&example=Widgets%2FBridge

But if you search this forum then there are some much better examples of how to use Bridge code.

Pete.

A description of the BRIDGE widget, how it works, and example code is on the Blynk Docs page. . .

There is also an example in the Blynk Examples folder in Arduino IDE . . .

Play around with the examples and see how you go . . .

billd

thanks sir,

sir i want to know that how many device we can connect through bridge.Like i have three device A,B and C i want to send data to A from B and C can will it be possible.

Yes, it’s possible. If you search the forum you’ll find at least one example of how to do this.

Pete.