I am getting following error while compiling servo library on Adafruit Metro M4 Grand Central
/home/Downloads/arduino-1.8.9/libraries/Servo/src/samd/Servo.cpp: In function 'void Servo_Handler(timer16_Sequence_t, Tc*, uint8_t, uint8_t)':
/home/Downloads/arduino-1.8.9/libraries/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::<anonymous>' has no member named 'SYNCBUSY'
#define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);
^
/home/Downloads/arduino-1.8.9/libraries/Servo/src/samd/Servo.cpp:64:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'
WAIT_TC16_REGS_SYNC(tc)
^
/home/Downloads/arduino-1.8.9/libraries/Servo/src/samd/Servo.cpp: In function 'void _initISR(Tc*, uint8_t, uint32_t, IRQn_Type, uint8_t, uint8_t)':
/home/Downloads/arduino-1.8.9/libraries/Servo/src/samd/Servo.cpp:123:11: error: 'struct Gclk' has no member named 'CLKCTRL'
GCLK->CLKCTRL.reg = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_ID(gcmForTimer));
^
/home/Downloads/arduino-1.8.9/libraries/Servo/src/samd/Servo.cpp:123:37: error: 'GCLK_CLKCTRL_CLKEN' was not declared in this scope
GCLK->CLKCTRL.reg = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_ID(gcmForTimer));
Rename the unzipped folder from Servo-adafruit_samd51 to Servo.
(In the Arduino IDE) Sketch > Include Library > Add .ZIP Library
Select the Servo folder you just renamed. Note: don't select the Servo-adafruit_samd51.zip file. Despite the name, "Add .ZIP Library" also works to install from folders and the folder must have the right name for this to work.
Click the "Open" button.
Wait until the status bar on the Arduino IDE shows a message that the library was installed.
After that, you should be able to now use the Servo library with your Grand Central.
I think that board suggests a different servo control method.
That tutorial is for if you're using CircuitPython (Adafruit's porting of the Python programming language for microcontrollers like the SAMD51). mlre is using Arduino, not CircuitPython so that tutorial is not relevant here.