It is not to remove but to replace, but it seems you are messing about without knowing what to do, and you don't post the sketch that is causing the issue
#include <Servo.h>
#define numservos 34 // Number of Servos
Servo servo[numservos] ;
int servo_delay = 40; // Servo inter-step delay in milliseconds
int i, j, k, l;
int pins [ ] = {36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69
}; // Toggle Switch pins (34)
int spins [ ] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35
}; // Servo pins (34)
int sstart [ ] = {25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25
}; // Servo Start Positions
int sstop [ ] = {160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160
}; // Servo Stop Positions
int spos [ ] = {25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25
}; // Servo Current Positions initially should be same as sstart[]
//
void setup() {
for (i = 0; i < numservos; i++) {
servo[i].attach (spins[i]); // Set up servo controls
servo[i].write(sstart[i]); // Set each servo to start position
}
pinMode(pins[i], INPUT_PULLUP); // Initialize Toggle pins
}
void loop() {
for (i = 0; i < numservos; i++) {
if (digitalRead(pins[i]) == HIGH) { // Check if a Pushbutton is pressed
if (sstart[i] < sstop[i]) {
for (j = spos[i]; j >= sstart[i]; j--) {
servo[i].write(j);
delay (servo_delay);
}
} else { //Now sstart[] > sstop[]
for (j = spos[i]; j <= sstart[i]; j++) {
servo[i].write(j);
delay (servo_delay);
}
}
spos[i] = sstart[i];
} else { // Pinval[i]==false Move the servo to sstop[i]
if (sstart[i] < sstop[i]) {
for (j = spos[i]; j <= sstop[i]; j++) {
servo[i].write(j);
delay (servo_delay);
}
} else { //Now sstart[] > sstop[]
for (j = spos[i]; j >= sstop[i]; j--) {
servo[i].write(j);
delay (servo_delay);
}
}
spos[i] = sstop[i];
}
}
}
This compiles for a Mega. Don't know if it works, but that is a different matter, actually i have some issues with the pin nrs. Mega has no more pins than 54.