Sketch to slow servo speed when using flex sensor

Hi all, I've been building a small kinetic sculpture that relies on a flex sensor (glove) to instigate the movement via a servo. Although it works the motion of the servo is too quick. I need the servo to respond instantly to the sensor initially, but reduce its rotation speed, slowing up the sculpture movement thereafter and returning to its original position.
I guess I'm after a sketch that sort of combines the following two sketches I have found online.
I hope I'm making sense..... any help would be much appreciated.
the first sketch

#include <Servo.h>

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

void setup()
{
myservo.attach(7);
myservo1.attach(8);
Serial.begin(9600);
}

void loop()
{
for(int x=0; x<20; x++)
{
flex[x]=analogRead(flexpin);
flex1[x]=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,870,800,0,90);
pos1=map(flexsum1,870,800,0,90);
myservo.write(pos);
myservo1.write(pos1);

delay(200);
}

the second sketch to reduce speed is

#include <Servo.h> 
  
Servo myservo;  // create servo object to control a servo 
                // a maximum of eight servo objects can be created 
  
int pos = 0;    // variable to store the servo position 
  
void setup() 
{ 
  myservo.attach(8);  // attaches the servo on pin 9 to the servo object 
} 
  
  
void loop() 
{ 
  for(pos = 0; pos <= 85; pos += 1)  // goes from 0 degrees to 180 degrees 
  {                                  // in steps of 1 degree 
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(70);                       // waits 15ms for the servo to reach the position 
  } 
  for(pos = 85; pos>=0; pos-=1)     // goes from 180 degrees to 0 degrees 
  {                                
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(70);                       // waits 15ms for the servo to reach the position 
  } 
}

Please assist

Quick and dirty method.
Put all the code in the loop() function of the second program in a function in the first program and call it instead of
myservo.write(pos);in the first program. Do you want/need the servos to move at the same time ? If so then it is a little more complicated but I suggest that you get one working first.

Incidentally, what does this do for you in the first program ?

if(Serial.available())
{
Serial.println(flexsum);
Serial.println(flexsum1); 
delay(100);
}

You have no serial input so the test will always fail.

I assume that you know that the second program does not do exactly what the comments say

  for(pos = 0; pos <= 85; pos += 1)  // goes from 0 degrees to 180 degrees

many thanks for the reply...this unfortunately is a bit new to me and I'm probably trying to run before walking... (all the fingers in the image attachment) shown will work independently when, and you're right to say, I get one working.... Both of the sketches work fine when I have uploaded to the red board. I'm trying to figure the code and have made alterations but I'm not entirely confident in my skills. I would be quite happy with the servo to be initiated by the flex sensor, to then slowly move through a cycle/ loop and return to original position, to be triggered again by the flex sensor and so on..(the flex sensor working as a trigger). What do you think?
regards

Try this as a start point

#include <Servo.h>

int flexpin=A0;
int pos;

Servo myServo;
int flexSum;

void setup()
{
  myServo.attach(7);
}

void loop()
{
  flexSum = 0;
  for(int x=0; x < 20; x++)
  {
    flexSum = flexSum + analogRead(flexpin);
    delayMicroseconds(14);
  }
  flexSum = flexSum / 20;

  pos = map(flexSum,870,800,0,90);
  moveServo(pos);
}

void moveServo(int targetPos)
{ 
  for(int servoPos = 0; servoPos <= targetPos; servoPos++)
  {                      
    myServo.write(servoPos);
    delay(70);
  } 

  for(int servoPos = targetPos; servoPos >= 0; servoPos--) 
  {                                
    myServo.write(servoPos);
    delay(70);
  }
}

I do not have the hardware to try it on so there may be problems with it. Note that it only deals with one sensor and servo but that can be extended using arrays, and that I have changed some of your variable names to make more sense.

Many thanks for your time there, I'll try and hook it up as soon as possible and let you know how it works
regards