A circuit diagram and a copy of your code plus complete project description (what is this all supposed to do in the first place) would be enlightening.
A circuit diagram and a copy of your code plus complete project description (what is this all supposed to do in the first place) would be enlightening.