the code compiles and runs flawlessly in proteus, thats not the issue , check your circuit

Name:  curio.jpg
Views: 13859
Size:  196.5 KB