The servo has a physical top speed. The code can slow it down with delays, but can't speed it up beyond the physical speed of the motor.
Maybe you could get more speed out of it by using the maximum voltage that the Servo will take, or switching to a faster servo, but that's a hardware problem.
The code you posted is written to move the servo slowly. If you want the servo to move at its "catalog" speed, replace the for(pos) {} loop with a HCPCA9685_1.Servo(servoNumber, servoPosition); statement.
New code :
#include <SoftwareSerial.h>
#include <Servo.h>
#include "HCPCA9685.h"
SoftwareSerial BT(13, 12); //RX , TX pins
char state = 0;
/* I2C slave address for the device/module. For the HCMODU0097 the default I2C address
is 0x40 */
#define I2CAdd_1 0x40
#define I2CAdd_2 0x41
int pos1 = 200;
int pos2 = 220;
int pos3 = 180;
int pos4 = 0;
int pos5 = 130;
int pos6 = 100;
int pos7 = 50;
int pos8 = 260;
int pos9 = 140;
int delay1;
int delay2 = 500;
/* Create an instance of the library */
HCPCA9685 HCPCA9685_1(I2CAdd_1);
HCPCA9685 HCPCA9685_2(I2CAdd_2);
void setup() {
/* Initialise the library and set it to 'servo mode' */
// Initialise both modules
HCPCA9685_1.Init(SERVO_MODE);
HCPCA9685_2.Init(SERVO_MODE);
// Wake both devices up
HCPCA9685_1.Sleep(false);
HCPCA9685_2.Sleep(false);
HCPCA9685_1.Servo(2, pos6);
}
void loop() {
}
Each time you see that kind of for(pos) loop, delete the parts crossed out in red and directly place the final position (pos6 here) inside the parentheses.
This has been a hundred-posts, never-ending, tail-chasing, six-steps-back, ordeal over multiple topics with the same subject. Follow the activities to get the whole story, because answers will never be given when asked for over and over.
there are no differences between servo with for loop or with out it in speed. And I think my experience in electronic or progtamming is not ralated to you. If you have enough experience offer asolution othervise be silent.