Controlling a DC motor using PWM and a potentiometer

Hi, i'm.sorry if i.have so many typ, i typing using a phone.
I would recommend you to use the map function