advice needed on pin mapping

Hello,

For the control of a Animatronic Lion, I need to run 13 digital servos but Uno only provides 12 outputs.
I understand that via pin mapping I can re-map some ports…? I just need one more port!

This is what I found in the tutorials but have no clue how to use it within the sketch I am using…

pinMode(A0, OUTPUT);
digitalWrite(A0, HIGH);

http://animatronicsworkshop.com/?page_id=458 is where I found a good functioning sketch to use the Uno as a controller in combination with the VSA software.

I use the professional VSA software from www.brookshiresoftware.com to do the animation.

I build a small test setup, running several servos and that works like a charm…now I found out I need 13 channels instead of 12 but still want to use the Uno. I just need one more channel…

Can anyone help me to change the sketch I am using? (I have no skills in programming what so ever)

Thanks in advance!

// Serial Servo
// by Paul H. Dietz, 4/22/2014
//
// Allows an Arduino UNO to act like a Scott Edwards Mini Serial Servo Controller.
//
// Data Format:
//
// 9600 baud, 8-N-1
//
// Sync byte (255), Servo Num (2-13), Postion (0-254)
//
// Position to us:
//
// 6 * Position + 738
//
// 0 → 738us, 254 → 2262us
//
// This code is in the public domain. Use at your own risk.

#include <Servo.h>

byte ServoNum, ServoPos;

// Byte count for input
byte inCNT=0;

// create servo objects
Servo servo2, servo3, servo4, servo5, servo6, servo7, servo8, servo9, servo10, servo11, servo12, servo13;

void setup()
{
// Initialize serial:
Serial.begin(9600);

// Initialize Servos
servo2.attach(2);
servo3.attach(3);
servo4.attach(4);
servo5.attach(5);
servo6.attach(6);
servo7.attach(7);
servo8.attach(8);
servo9.attach(9);
servo10.attach(10);
servo11.attach(11);
servo12.attach(12);
servo13.attach(13);

}

/* Wait for data, then process

inCNT keeps track of current state:

0 – Waiting for sync byte
1 – Sync byte received
2 – Sync byte and ServoNum received

*/
void loop() {
while (Serial.available()) {
// get the new byte:
byte inByte = Serial.read();
if (inByte == 255){
// Sync found
inCNT = 1;
}
else {
if (inCNT == 1) {
ServoNum = inByte;
inCNT = 2;
}
else {
if (inCNT == 2) {
ServoPos = inByte;
setServo();
inCNT = 0;
}
else {
inCNT = 0;
}
}
}
}
}

void setServo() {

switch (ServoNum) {
case 2:
servo2.writeMicroseconds((int)ServoPos6+738);
break;
case 3:
servo3.writeMicroseconds((int)ServoPos
6+738);
break;
case 4:
servo4.writeMicroseconds((int)ServoPos6+738);
break;
case 5:
servo5.writeMicroseconds((int)ServoPos
6+738);
break;
case 6:
servo6.writeMicroseconds((int)ServoPos6+738);
break;
case 7:
servo7.writeMicroseconds((int)ServoPos
6+738);
break;
case 8:
servo8.writeMicroseconds((int)ServoPos6+738);
break;
case 9:
servo9.writeMicroseconds((int)ServoPos
6+738);
break;
case 10:
servo10.writeMicroseconds((int)ServoPos6+738);
break;
case 11:
servo11.writeMicroseconds((int)ServoPos
6+738);
break;
case 12:
servo12.writeMicroseconds((int)ServoPos6+738);
break;
case 13:
servo13.writeMicroseconds((int)ServoPos
6+738);
break;
}
}

**Stop cross-posting! **

Please read this How to Use This Forum like you were asked to on your other thread. You claim you did. You can probably skip the parts about how to create an account, but pay particular attention to point 7 about code tags and the other parts about forum rules.

This shield will let you control 16 servos and interrupts (SoftawreSerial, for example) won’t cause servo jitter. If you are using another shield you can use the module version which uses the I2C bus: Adafruit 16-Channel 12-bit PWM/Servo Driver - I2C interface [PCA9685] : ID 815 : $14.95 : Adafruit Industries, Unique & fun DIY electronics and kits

The analog pins A0-A5 can also be using as digital GPIO. You should be able to attach your final servo to one of those.

ServoA0.attach(A0);