Controlling 2 servo using flex sensor in 2 arduino over serial (3DR radio)

Controlling 2 servo using flex sensor in 2 arduino over serial (3DR radio telemetry)

iam using mega 2560(master) and arduino uno(slave)
actually, i success to control 1 servo from 1 sensor (flex)
but, how to control 2 servos or more? i read this, but still confusing :frowning:

and here

this is my code to control 1 servo from 1 sensor
transmiter

#include <Servo.h>  

 int flexpin=A2;
//int flexpin1=A1;
int pos=90;
//int pos1=90;
Servo myservo, myservo1;
int flex[20];
//int flex1[20];
int flexsum=0;
 

void setup()
{
  Serial.begin(9600);  //Begin Serial to talk to the Serial Monitor   
  Serial1.begin(9600); //Begin Serial to talk to the Rx Arduino
  Serial.println("Serial Monitor Connected"); 
  
  delay(100);
}

void loop()
{

          for(int x=0; x<20; x++)
        {
          flex=analogRead(flexpin);
          //flex1=analogRead(flexpin1);
        flexsum=flexsum+analogRead(flexpin);
      //flexsum1=flexsum1+analogRead(flexpin1);

        delayMicroseconds(14);
        }
        flexsum=flexsum/20;
      //flexsum1=flexsum1/20;
        if(Serial.available())
        {
        Serial.println(flexsum);
      //  Serial.println(flexsum1); 
        delay(100);
       }
        pos=map(flexsum,530,770,180,60);
        //pos1=map(flexsum1,870,800,0,180);
        Serial.println(pos);
        Serial.println(flexsum);
        Serial1.println(pos);
     // myservo.write(pos);
      //myservo1.write(pos1);

        delay(200);
}

and this is RX code

 #include <Servo.h>  
 
int val = 0;
int incoming = 0;
int pos = 0;
Servo myservo, myservo1;

void setup()
{
  myservo.attach(3); 
  Serial.begin(9600);

}

void loop()
{
  incoming = Serial.available();
  while (incoming != 0)                 //While there is something to be read
  {
    val = Serial.parseInt();             //Reads integers as integer rather than ASCI. Anything else returns 0
    
       myservo.write(val);
  
  }
}

thx for helping :wink: