Can you help me modify my code?
To do what? You should have written a number of other sketches to verify each piece of hardware. Trying to write one program without testing individual pieces, standalone, is an exercise in frustration.
Did those other sketches work? If not, let us know when you have them all working. Or what they look like and what problems you have with them.
And, "it's not working" should NEVER be your only comment about the code.