This is input from sending device. As Gunner on his post : C++ Blynk (Legacy) - Code Examples for Basic Tasks - #22 by Gunner
With gauge on receiving devices i’ve value ( on V44 and V43 ) from sender
Sending sketch :
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <DHT.h>
#define DHTPIN 2 // What digital pin we're connected to
// Uncomment whatever type you're using!
#define DHTTYPE DHT11 // DHT 11
//#define DHTTYPE DHT22 // DHT 22, AM2302, AM2321
//#define DHTTYPE DHT21 // DHT 21, AM2301
DHT dht(DHTPIN, DHTTYPE);
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "IlcMe5hpdqwqpsoisIObIkhtNuRRq_k9";
char ssid[] = "indoor";
char pass[] = "indoorwifi";
BlynkTimer timer;
float h = dht.readHumidity();
float t = dht.readTemperature();
WidgetBridge bridge1(V1);
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass, IPAddress(10, 3, 141, 1), 8080);
dht.begin();
// Setup a function to be called every second
timer.setInterval(1000L, sendSensor);
}
BLYNK_CONNECTED() {
bridge1.setAuthToken("VsfeTTqiW4sizahXIBbECZSp0NohKEm_"); // Token of the hardware B
}
void loop()
{
Blynk.run();
timer.run();
}
void sendSensor()
{
float h = dht.readHumidity();
float t = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V20, h);
Blynk.virtualWrite(V21, t);
bridge1.virtualWrite(V43, t);
bridge1.virtualWrite(V44, h);
}
Receiving sketch :
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = "VsfeTTqiW4sizahXIBbECZSp0NohKEm_";
char ssid[] = "indoor";
char pass[] = "indoorwifi";
BlynkTimer timer;
//
WidgetBridge bridge1(V1);
//
int minRange = 70;
int maxRange = 80;
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass, IPAddress(10, 3, 141, 1), 8080);
digitalWrite(2 , LOW);
delay(1000L);
digitalWrite(2 , HIGH);
}
void loop()
{
Blynk.run();
timer.run();
}
BLYNK_WRITE(V43) {
Blynk.virtualWrite(V43, param.asFloat());
}
BLYNK_WRITE(V44) {
Blynk.virtualWrite(V44, param.asFloat());
}
void relais ()
{
if (V44 > minRange)
{
digitalWrite(2, HIGH);
}
else
{
digitalWrite(2, LOW);
}
}