Servo Array in 12 Servo Control Program

I've done a bit of research, but found nothing that really answered my specific problem.

Among other messes, I have a servo declaration in the start of my program that contains the following:

//---Servos: 12 x HS-5645MG (~750us - ~2200us)------
int ServoList[12] =           {0,    1,    2,    12,   13,   14,   16,   17,   18,   28,   29,   30};  //Servo pin #
int ServoCenters[12] =        {1800, 1900, 1250, 1200, 1100, 1750, 1200, 1100, 1750, 1800, 1900, 1250}; // The starting position of each servo that moves the body into a nice standing state
int Servo_OUT_UP_Limit[12] =  {2200, 750,  700,  750,  200,  750,  750,  2200, 750,  2200, 750,  2200}; The physical or digital limits of each servo moving away or up from the body
int Servo_IN_DOWN_Limit[12] = {1000, 2000, 2200, 1500, 1100, 2200, 2000, 1100, 2200, 1500, 1900, 750}; // The physical or digital limits of each servo moving towards or down from the body 
int ServoGroup[12] =          {1,    1,    1,    2,    2,    2,    3,    3,    3,    4,    4,    4,};

I need a way to control 12 servo in a 3-DOF quadruped, but I wanted to keep things relatively clean and use only a single function with multiple arguments to control each servo. The problem is that some of the servos are inverted, some (due to the asymmetrical nature of the quadruped) have physical limits. Some servos are used for Y movement and some for X shifts.

Is there a simpler way to address all the aspects of a servo in one call?
Ex: servoMove(sev_number, inverted?, Center?, distance_of_move)
taking into account boundaries and correcting by limiting movement.

My biggest problem is that I'm totally overwhelmed when 12 servos move at once, I'm trying to track errors and whatnot, but it's too hard to look at each servo.

I want to be able to use a number in a simple data range (say 0--->255) and have that be the same distance, move, and direction for every single servo.

I recently picked up and Arduino after a bit and am pretty rusty, I have a servo controller that's taking these commands over serial (SSC-32)

Is there a simpler way to address all the aspects of a servo in one call?

Simpler than what?

You know, comments do not HAVE to be on the same line as the statement they go with. Not having to scroll 6 screens sideways is a good thing.

1: The comments were last minute, and full screen for me (maybe get a better computer)
2: A simple way to address all of the aspects of a servo, think like a memory call:
ServoInfo[8,3] could return (SERVO_IN_DOWN, 2200);
So that I could call one function to return a bunch of different data types

And sure, that's what I want to do, but is there a better way?

Sarcasm really isn't appreciated, I'm just looking to finish my project.

ServoInfo[8,3] could return (SERVO_IN_DOWN, 2200);

Not in C.

You probably want to look in structs.

You probably could use a multi-dimensioned array but I think an array of structs would be easier to keep track of.

The struct should define all the data elements for 1 servo. I think the syntax is

struct servoStruct {
byte pin;
int center;
int upLimit;
int downLimit;
byte group;


Is there a simpler way to address all the aspects of a servo in one call?

What is generating the commands for the servos? Below is arduino multi servo code, but if you are using an ssc-32, then the arduino might just act as the serial interface between the command generating device and the ssc-32.

//zoomkat 11-22-12 simple delimited ',' string parse 
//from serial port input (via serial monitor)
//and print result out serial port
//multi servos added 
// Powering a servo from the arduino usually *DOES NOT WORK*.

String readString;
#include <Servo.h> 
Servo myservoa, myservob, myservoc, myservod;  // create servo object to control a servo 

void setup() {

  //myservoa.writeMicroseconds(1500); //set initial servo position if desired

  myservoa.attach(6);  //the pin for the servoa control
  myservob.attach(7);  //the pin for the servob control
  myservoc.attach(8);  //the pin for the servoc control
  myservod.attach(9);  //the pin for the servod control 
  Serial.println("multi-servo-delimit-test-dual-input-11-22-12"); // so I can keep track of what is loaded

void loop() {

  //expect single strings like 700a, or 1500c, or 2000d,
  //or like 30c, or 90a, or 180d,
  //or combined like 30c,180b,70a,120d,

  if (Serial.available())  {
    char c =;  //gets one byte from serial buffer
    if (c == ',') {
      if (readString.length() >1) {
        Serial.println(readString); //prints string to serial port out

        int n = readString.toInt();  //convert readString into a number

        // auto select appropriate value, copied from someone elses code.
        if(n >= 500)
          Serial.print("writing Microseconds: ");
          if(readString.indexOf('a') >0) myservoa.writeMicroseconds(n);
          if(readString.indexOf('b') >0) myservob.writeMicroseconds(n);
          if(readString.indexOf('c') >0) myservoc.writeMicroseconds(n);
          if(readString.indexOf('d') >0) myservod.writeMicroseconds(n);
          Serial.print("writing Angle: ");
          if(readString.indexOf('a') >0) myservoa.write(n);
          if(readString.indexOf('b') >0) myservob.write(n);
          if(readString.indexOf('c') >0) myservoc.write(n);
          if(readString.indexOf('d') >0) myservod.write(n);
         readString=""; //clears variable for new input
    else {     
      readString += c; //makes the string readString
// auto select appropriate value, copied from someone elses code

Probably not necessary; the Servo class automatically maps times below about (from memory) 540us to "angles", and passes values above this directly to writeMicroseconds.