UPM library for the PCA9685-based Adafruit 16-channel servo shield. If 3 or more GWS servos are attached, results could be unpredictable. Adafruit Industries recommend installing a capacitor on the board, which should alleviate the issue. Sizing depends on servos and their number.
for (;;)
{
cout << "Setting all to 0" << endl;
for (n = 0; n < 16; n++)
usleep(1000000);
cout << "Setting all to 45" << endl;
for (n = 0; n < 16; n++)
usleep(1000000);
cout << "Setting all to 90" << endl;
for (n = 0; n < 16; n++)
usleep(1000000);
cout << "Setting all to 135" << endl;
for (n = 0; n < 16; n++)
servos->
servo(n, 1, 135);
usleep(1000000);
cout << "Setting all to 180" << endl;
for (n = 0; n < 16; n++)
servos->
servo(n, 1, 160);
usleep(2000000);
}