you would need something like PWM kit to do what you need ...

https://shop.m5stack.com/products/atomic-pwm-base-fdd8447l