Navigation

servo

Arduino - servos example

#include <Servo.h> 
#define number_of_servos 12
#define servo_max_possition 100
#define min_possition 20
#define max_working_servos 6
Servo servos[number_of_servos];
int servoPins[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
int servoStatus[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int servoPosition[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int servoSpeed[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int active_servos = 0;
int i;

void setup() 
{ 
  for (i=0; i<number_of_servos; i++) 
  {
    servos[i].attach(servoPins[i]);
    servos[i].write(min_possition);
Subscribe to servo