Hi, I’m new to programing and electronic things. I trying to figure are there any possibility that we can combine two widgets together since I’m trying to send my gps coordinate from my phone (using the gps widget) to the terminal widget on Blynk app. Thanks!. I’m using the Wemos d1 r1
Firstly, as per the welcome topic, you need to properly format any posted code in this forum, for proper viewability…
Your title is a bit misleading as you are not really combining widgets… just the usual “use sensor to get data and display to show data” routine.
As for your question… yes, it can be done… probably similar to how your code sorta looks (I have not looked at it that close in it’s unformatted format… I find reading the flow of others code a challenge when I can see it correctly, let alone when I can’t …thats my story and I am sticking too it )
So anyhow… What are your results and what is the issue?
I’m basically trying to get my phone GPS coordinates to be send from virtual pin V0 to the terminal widget pin V3 when ever I enter 1, 2 or 3 in the terminal . Here is the code
Arduino_Blynk_system:14: error: 'terminal' was not declared in this scope
terminal.clear();
^
Arduino_Blynk_system:19: error: a function-definition is not allowed here before '{' token
BLYNK_WRITE(V0){
^
exit status 1
'terminal' was not declared in this scope
But if I separate the two Blynk function I can’t use its own function. For example, the param.asStr in the terminal widget V3 or to get the data from the GPS widget to apply in the terminal widget.
It mean that whenever I enter 1 in the terminal widget. It will proceed the if statement in the BLYNK_WRITE(V3) function to get the coordinate from Virtual Pin 0
Besides, the BLYNK_WRITE() function is for a widget sending data to the device… to send data back to another widget you just use the terminal.print() or Blynk.virtualWrite() commands from inside the receiving function.
How can you turn the GPS data obtained from the GPS widget to global variances? Since you can only get the gps data when you are in the BLYNK_WRITE function. If there are a way, can you show me a few lines of code. That would help much. Thanks!