malfunctioning....

This may come as quite a shock to you, but nobody here can see your code or your circuit. So nobody here can possibly know if you've got a broken board or if you have made a mistake. I'm betting you have a floating pin. Common mistake for people to make. But unless you want to show us the schematic and the code no one here will ever be able to tell you.