How to implement on the Raspberry pi 3 B+ servo drive operation?

Guys tell me something like that.
Hooked MG90S servo to your Raspberry PI 3 B+ GPIO12 that is a pin that supports hardware PWM.

Using library RPi.GPIO with a simple code:
spoiler
import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)

GPIO.setup(12,GPIO.OUT)

p = GPIO.PWM(12,50)
p.start(7.5)

try:
while True:
p.ChangeDutyCycle(7.5)
time.sleep(0.5)
p.ChangeDutyCycle(12.5)
time.sleep(5)

except KeyboardInterrupt:
p.stop()

GPIO.cleanup()

The servo operates smoothly.
The question is, how best to implement work with the hardware PWM?
What library to use, are there any examples of code?
The fact that I'm not strong in programming, and the network could not find the instructions can You tell me?
March 19th 20 at 08:30
1 answer
March 19th 20 at 08:32
Any way, the implementation of PWM miserable.
discussed for example here: https://codius.ru/articles/Raspberry_Pi_3_GPIO_часть_2

Find more questions by tags Raspberry Pi