Will this do the job?

Will this code control a servo like this video?

You've got the code. You've got the hardware. You've watched the video. Did the code do what you wanted?