PWM Code to for mosfet gate

yup it worked thank you, but i used another code which worked fine for me