I'm sorry, but YouTube does not give me any confidence in what you did. But at least you checked it. Where is the wiring diagram I asked for?
If the code and the whole project really comes from a YouTube project, though, you should provide a link to it.