Hello, I am making a small code for arduino where I controle servos with array. What I am trying to find out is to control how long it will take myservo 1 for example to travel from index 2 to 3. I would like to do that with int del1. If you could point me tovards some answere would be great.
Hope this makes sence
Best
Ingirafn
#include <Servo.h>
Servo myservo1;
Servo myservo2;
int serv1[] = {10, 10, 20, 20, 10};
int serv2[] = {10, 20, 20, 10, 10};
int del1[] = {10, 10, 20, 20, 10}; // i imagien i would use this to contol different "delays".
int pos ;
int pause = 150;
int times = 4;
void setup()
{
myservo1.attach(10);
myservo2.attach(9);
}
void loop()
{
for(int i=0; i<times; i=i+1)
{
myservo1.write(serv1[i]); // here i would try to control how fast it will jump from one stepp to the other (one index to another in "myserv1 and 2", //preferably as a array also.
myservo2.write(serv2[i]);
delay(pause);
}
}