I'm using Teensy hardware specifically. I have a Teensy 2.0 and a Teensy 3.0, and from the documentation it seems like there are two 16 bit timers available, and each should be able to control 12 servos. However, I've attached a logic analyzer and have confirmed that only the first 12 servos attached ever function.
Is there anything special I have to do with my sketch in order to convince the Servo library to allocate the second timer for servos attached beyond number 12?
This works:
#define NUM_SERVOS 12
Servo servos[NUM_SERVOS];
// teensy 2.0 pins
int pin_assignments[NUM_SERVOS] = {0, 1, 2, 3, 4, 5, 20, 19, 18, 17, 16, 15};
void setup() {
for(int i = 0; i < NUM_SERVOS; i++) {
servos[i].attach(pin_assignments[i]) ;
}
}
But this, below, only ever shows activity on the first twelve pins attached:
#define NUM_SERVOS 24
Servo servos[NUM_SERVOS];
// teensy 3.0 pins
int pin_assignments[NUM_SERVOS] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23};
void setup() {
for(int i = 0; i < NUM_SERVOS; i++) {
servos[i].attach(pin_assignments[i]) ;
}
}
int pin_assignments
meant to be commented out? $\endgroup$