I am trying to read data from a blynkBlynk widget via esp8266ESP8266 and arduino unoArduino UNO and trying to send it to another slave arduino unoArduino UNO. But But, the probleproblem is the data is taking some time to reach to the slave arduinoArduino for futherfurther processing and iI need it to be fast as it is needed for controlling a drone... The codes are given below...
If any one can help... Plz, please help. I am a tenth grader and a newbie...so i dont So, I don't have a lot of experience... PLEASE HELP
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <SoftwareSerial.h> //We are using software serial so as not to conflict with serial download and monitor
SoftwareSerial mySerial(5,6); // RX, TX
int of=0;
int throttle=0;
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "auth";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "wifi_name";
char pass[] = "wifi_pass";
// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1
// or Software Serial on Uno, Nano...
//#include <SoftwareSerial.h>
//SoftwareSerial EspSerial(2, 3); // RX, TX
// Your ESP8266 baud rate:
#define ESP8266_BAUD 115200
ESP8266 wifi(&Serial);
WidgetLED l(V3);
void setup()
{
// Debug console
Serial.begin(9600);
delay(10);
// Set ESP8266 baud rate
Serial.begin(ESP8266_BAUD);
delay(10);
Blynk.begin(auth, wifi, ssid, pass);
mySerial.begin(9600);
}
void loop()
{
Blynk.run();
l.on();
mySerial.write(of);
mySerial.write(throttle);
}
BLYNK_WRITE(V1)
{
of = 100+param.asInt();
}
BLYNK_WRITE(V2)
{
throttle = param.asInt();
}
Here is the code for the master arduinoArduino:
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <SoftwareSerial.h> //We are using software serial so as not to conflict with serial download and monitor
SoftwareSerial mySerial(5,6); // RX, TX
int of=0;
int throttle=0;
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "auth";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "wifi_name";
char pass[] = "wifi_pass";
// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1
// or Software Serial on Uno, Nano...
//#include <SoftwareSerial.h>
//SoftwareSerial EspSerial(2, 3); // RX, TX
// Your ESP8266 baud rate:
#define ESP8266_BAUD 115200
ESP8266 wifi(&Serial);
WidgetLED l(V3);
void setup()
{
// Debug console
Serial.begin(9600);
delay(10);
// Set ESP8266 baud rate
Serial.begin(ESP8266_BAUD);
delay(10);
Blynk.begin(auth, wifi, ssid, pass);
mySerial.begin(9600);
}
void loop()
{
Blynk.run();
l.on();
mySerial.write(of);
mySerial.write(throttle);
}
BLYNK_WRITE(V1)
{
of = 100+param.asInt();
}
BLYNK_WRITE(V2)
{
throttle = param.asInt();
}