I am writing to you because I have a problem with BLYNK_WRITE.
I would like to receive data from a remote device (Wemos 8266) on arduino Mega Ethernet, I am using the following function:
BLYNK_WRITE (V15) {
xxxxx = param.asInt();
Serial.print("V15 pulsante ");
Serial.println(XXXX);
}
As you can see on my program, I have two Virtual Pins to detect, one is a V15 button, the other (V44) is a float datum that corresponds to a consumption reading in Watts.
If I change the state of the V15 button on the Mega device I detect the change of state, The ‘Button’ variable is updated. Each time you press the Blynk app, the status changes.
Instead the V44 when I start the program on Mega the data is read the first time, then, when the ‘Watt’ value changes, it is no longer updated.
I hope I have been clear and that my problem is understood. I read several posts on the subject but found no answer.
Thank you
• Arduino Mega with Ethernet Shield ENC28J60
• Smartphone IOS
• Blynk Library version 0.5.4
#define BLYNK_PRINT Serial
#include <UIPEthernet.h>
#include <BlynkSimpleUIPEthernet.h>
char auth[] = "xxxxxxxxx";
float Wat=1;
float Pulsante;
BLYNK_WRITE (V44) {
Wat = param.asInt();
Serial.print("V44 Watt : ");
Serial.println(Wat);
}
BLYNK_WRITE (V15) {
Pulsante = param.asInt();
Serial.print("V15 pulsante : ");
Serial.println(Pulsante);
}
BLYNK_CONNECTED() {
Blynk.syncAll();
Blynk.syncVirtual(V44,V15);
}
void setup() {
Serial.begin(9600);
Ethernet.init(16);
Blynk.begin(auth);
}
void loop() {
Blynk.run();
delay(1000);
}
07:30:27.546 -> [0] Getting IP...
07:30:32.762 -> [5199] IP:192.168.1.29
07:30:32.762 -> [5199]
07:30:32.797 -> ___ __ __
07:30:32.797 -> / _ )/ /_ _____ / /__
07:30:32.832 -> / _ / / // / _ \/ '_/
07:30:32.866 -> /____/_/\_, /_//_/_/\_\
07:30:32.901 -> /___/ v0.5.4 on Arduino Mega
07:30:32.936 ->
07:30:32.936 -> [5317] Connecting to blynk-cloud.com:80
07:30:33.821 -> [6203] Ready (ping: 70ms).
07:30:34.004 -> V15 pulsante 0.00
07:30:34.004 -> V44 Slider value is: 110.00
07:30:34.038 -> V44 Slider value is: 110.00
07:30:36.151 -> V44 Slider value is: 110.00
07:30:36.151 -> V15 pulsante 0.00
07:30:39.244 -> V15 pulsante 1.00
07:30:42.324 -> V15 pulsante 0.00
07:30:44.391 -> V15 pulsante 1.00
07:30:50.556 -> V15 pulsante 0.00
07:30:50.556 -> V15 pulsante 1.00
07:30:52.626 -> V15 pulsante 0.00
07:30:58.796 -> V15 pulsante 1.00
07:31:00.858 -> V15 pulsante 0.00