I believe that you have changed your tutorial from Arduino based to totally Raspberry Pi. Could you please share what HAT driver are you exactly using? I am guessing DC Motor Driver HAT(V1.0) DFR0592. Could you please confirm? Thank you.
We are using the: Waveshare Servo Driver Hat for Raspberry Pi/Jetson Nano 16-Channel 2-bit I2C Interface PCA9685 Driver Supports
Here is the link to amazon page: https://www.amazon.es/Waveshare-Raspberry-16-Channel-Interface-Supports/dp/B07H6G87S5
Are you sure? I think the motors used in this course are DC and not servos. Please, confirm. Thank you.