servo motor control by A.UNO and Node MCU (Blynk Local Server)

Hello Guyz ,

I am doing my project on dual axis solar Tracker with two servo motor,4 LDR to take light as input to direct servos ,arduino,nodemcu,Blynk local server
It works fine individually with only arduino servos and ldr (ln this motors are connected to arduino and control with ldr inputs )
It works fine Individually with node mcu blynk local server as i can control both motor with app
(in this mototrs are connected to node mcu and controlled with blynk app )
everything work fine
But what is want is
i want to control motor with natural input from ldr to arduino and also from blynk app
what should i do ???
here is my sketches
1.Arduino sketch

#include <Servo.h>

// 180 horizontal MAX
Servo horizontal; // horizontal servo

int servoh = 180; // 90; // stand horizontal servo

int servohLimitHigh = 180;
int servohLimitLow = 0;

// 65 degrees MAX
Servo vertical; // vertical servo

int servov = 45; // 90; // stand vertical servo

int servovLimitHigh = 80;
int servovLimitLow = 15;

// LDR pin connections
// name = analogpin;

int ldrlt = 0; //LDR top left - BOTTOM LEFT <--- BDG

int ldrrt = 1; //LDR top rigt - BOTTOM RIGHT

int ldrld = 2; //LDR down left - TOP LEFT

int ldrrd = 3; //ldr down rigt - TOP RIGHT

void setup()
{ Serial.begin(9600);

// servo connections

// name.attacht(pin);

horizontal.attach(9);

vertical.attach(10);

horizontal.write(180);

vertical.write(45);

delay(3000);

}

void loop() 
{ int lt = analogRead(ldrlt); // top left

int rt = analogRead(ldrrt); // top right

int ld = analogRead(ldrld); // down left

int rd = analogRead(ldrrd); // down right

// int dtime = analogRead(4)/20; // read potentiometers

// int tol = analogRead(5)/4;

int dtime = 10; int tol = 50;

int avt = (lt + rt) / 2; // average value top

int avd = (ld + rd) / 2; // average value down

int avl = (lt + ld) / 2; // average value left

int avr = (rt + rd) / 2; // average value right

int dvert = avt - avd; // check the diffirence of up and down

int dhoriz = avl - avr;// check the diffirence og left and rigt

/*Serial.print("Bottom Left");

Serial.print(" ");
Serial.print(lt);
Serial.print(" ");

Serial.print("Bottom Right ");

Serial.print(" ");
Serial.print(rt);
Serial.print(" ");

Serial.print("Top Left");

Serial.print(" ");
Serial.print(ld);
Serial.print(" ");
Serial.print("Top Right ");

Serial.print(" ");
Serial.print(rd);
Serial.print(" ");

Serial.println();
*/

if (-1*tol > dvert || dvert > tol) // check if the diffirence is in the tolerance else change vertical angle

{

if (avt > avd)

{

servov = ++servov;

if (servov > servovLimitHigh)

{

servov = servovLimitHigh;

}

}

else if (avt < avd)

{

servov= --servov;

if (servov < servovLimitLow)

{

servov = servovLimitLow;

}

}

vertical.write(servov);

}

if (-1*tol > dhoriz || dhoriz > tol) // check if the diffirence is in the tolerance else change horizontal angle

{

if (avl > avr)

{

servoh = --servoh;

if (servoh < servohLimitLow)

{

servoh = servohLimitLow;

}

}

else if (avl < avr)

{

servoh = ++servoh;

if (servoh > servohLimitHigh)

{

servoh = servohLimitHigh;

}

}

else if (avl = avr)

{

// nothing

}

horizontal.write(servoh);

}

delay(dtime);

}

2.Node MCU Sketch

#include <ESP8266WiFi.h>


#define BLYNK_PRINT Serial

#include<Servo.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>


char auth[] = "VwKQeYeZPYh9Ec2bD2poMfK_XC4wywiy";

char ssid[] = "S";
char pass[] = "";
Servo s1;
Servo s2;
void setup()
{
 
  Serial.begin(9600);

 Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,0,103), 8080);
  s1.attach(15);//D8
  s2.attach(02);//D4
}

void loop()
{
  Blynk.run();
}
BLYNK_WRITE(V1)
{
 s1.write(param.asInt());
}
BLYNK_WRITE(V2)
{
 s2.write(param.asInt());
}

** i have one idea but i dont know how to inmplent it with hardware **

i tried connecting servo signal pin one at a time
first connected to arduino it works normal with natural ldr inputs
second i disconnect servo signal pin from arduino and connect to node mcu pin according to my pin diagram it works with blynk app
here my idea is to add switch like hardware part so that i dont have to connect and disconnect it everytime from both boards

please suggest an implenetation relation to this idea if any

Thank You!!!

If this were my project, I would use only the nodeMCU, I would not use a second Arduino. But nodeMCU has only one analog pin, and not many digital pins. So I would use either an analog multiplexer or an ads1115 to provide 4 analog channels.

sry but i dont have programming knowledge about multiplexer

I'm sorry too. I thought you wanted suggestions. I would not suggest using Uno and nodeMCU together, it is much more complex than using a multiplexer.

"sry but i dont have programming knowledge about multiplexer"

Multiplex chips are fairly simple chips that usually have 8 inputs that can be switched to one output, which is connected to the arduino analog input pin. I think 74HC4067 AND 74HC4051 are examples.