I understand this is not as straightforward as it could be, so keep asking questions and I can help.
Here is a servo section below that I used in a test. The key is that only certain pins can be used for servo outputs and those pins have to be configured in the OPP config before MPF can use them. On CobraPin 2.0.0 and higher, those pins are marked in silkscreen, but any CobraPin version will work. The pins are X-0-8, X-0-9, X-0-10, and X-0-11 (where X could be 0, 1, or 3).
I also attached a sample config file for Board 0 on CobraPin that enables servo outputs on 4 pins. This was the same OPP config I used for the MPF example below. The relevant servo line from the OPP Config is
'\x40', '\xff', '\xfe', '\x96', \
From the OPP interface document:
"If an STM32 wing 1 is configured as an input wing or a solenoid wing, the inputs to the wing can be
configured as outputs for driving servo motors. Each input can be individually configured as a PWM
output where the PWM period is 20 ms, and has a tick rate of 10 us. If the input configuration byte is
> 0x40, the PWM output has an active period of byteCfg * 10 us. The active portion of the PWM can
be configured from .64 ms to 2.55 ms. This allows PWM connections to be tested in white wood
mode. The PWM output can be modified using fade commands in the same way Neopixels can use
fade commands to move slowly between two positions without the host sending multiple commands."
So the breakdown of those 4 numbers is as follows:
'\x40' - set 0-0-8 as a servo with a power-on pulse command of 0.64ms
'\xff' - set 0-0-9 as a servo with no power-on pulse command
'\xfe' - set 0-0-10 as a servo with a power-on pulse command of 2.54ms
'\x96' - set 0-0-11 as a servo with a power-on pulse command of 1.5ms
servos:
servo1:
servo_min: 0
servo_max: 1
speed_limit: 20
positions:
0.392: servo1_up
0.784: servo1_down
reset_position: 0.588
reset_events: reset_servo1, machine_reset_phase_3
number: 0-0-8
servo2:
speed_limit: 40
positions:
0.392: servo2_left
0.784: servo2_home
reset_position: 0.588
reset_events: reset_servo2, machine_reset_phase_3
number: 0-0-9
servo3:
servo_min: 0
servo_max: 1
speed_limit: 80
positions:
0.392: servo3_up
0.784: servo3_down
reset_position: 0.588
reset_events: reset_servo3, machine_reset_phase_3
number: 0-0-10
servo4:
positions:
0.392: servo4_left
0.784: servo4_home
reset_position: 0.588
reset_events: reset_servo4, machine_reset_phase_3
number: 0-0-11