Read different values from Blynk App

Hi,
I would like to read a value from a label inside Blynk App, my project is I have a formula inside arduino code this formula has one value it should to read from a label inside Blynk App, Like:
result = 120 + V1
:V1 is changeable value from label (100 to 50000).

thanks

Labels are changeable via Blynk.setProperty(V0, “label”, “My New Widget Label”); but are not readable via code.

However by using any display type Widget you can have both the display of a value as well as its calculability via its associated virtual pin.

etc.

Currently any calculation must be done in the sketch, but there are indications that some App level calculation is forthcoming.

my project is I have equation with constant numbers but one of them is variable, so i have to keep change from the App, this one is a volume of Pool that will be different size of pool:
area = volume / deep
so the deep is constant but the volume is variable number, so i need to input that volume from the App by assign one virtual pin for it and by using one of your Widget with it. Also like you new the area will be showing up on App by any display Widget, but now my big problem with the volume.

how can i do that?

Math :stuck_out_tongue_winking_eye:

You take your App values V2 & V3 (Volume and depth) from whatever source they are (terminal, buttons, slider, step, etc.), then in the sketch you run the calculations (V1=V2/V3) and send the Area data back to a display widget (V1). Adjust your algebraic calculations accordingly to get calculated Volume or Depth values instead.

http://help.blynk.cc/blynk-basics

Can you help me with Code if V2 was a slider, V3 was number 10 and V1 was a LCD.

Thanks

Aside from you reading the links I already showed you, along with the Docs, Sketch builder, etc. (links at the upper right of this page), you also need to learn some basic C++ (Arduino code). This is not a code factory, but we can help you learn :wink:

So, unless you wish to change the V3 value on the fly (another slider?) then you wouldn’t need to assign the value 10 to anything, just use it in your calculation. e.g. valueOut = valueIn / 10 etc.

You would then use a BLYNK_WRITE(V2) function for the slider:

http://docs.blynk.cc/#blynk-firmware-virtual-pins-control-blynk_writevpin

Something like:

BLYNK_WRITE(V2)
{   
  int valueIn = param.asInt(); // Get value as integer
  // do math here
  // display data here
}

And Blynk.virtualWrite(V1, valueOut) for a Display Widget or lcd.print(x, y, valueOut); for the LCD Widget (after a bit of setup).

http://docs.blynk.cc/#blynk-firmware-virtual-pins-control-blynkvirtualwritevpin-value
http://docs.blynk.cc/#widgets-displays-lcd

2 Likes

That what I was looking for.

Thank you very much.

@Gunner formula will be introduced for new history graph soon.

2 Likes