how to find out what I am doing wrong
First, you need to understand what each piece of the system is supposed to be doing.
Then, you need to inspect/measure each piece of the system for whether it is doing the right thing or not.
Once you find out which piece or pieces are not doing what they're supposed to, you can start creating theories of why it isn't so, and start modifying the system to gain more insight into how to get it to actually work.
Learning how to do engineering means going through these three steps.
First, you have to understand how the pieces are supposed to work on their own.
Then, you have to learn how to measure various kinds of pieces for proper performance. This includes tools like multimeters, oscilloscopes, logic analyzers, and LEDs soldered to bits of wire.
Finally, you have to learn how complex system dynamics evolve from simple parts, and how to manage the complexity that arises in systems.
It's not clear to me which of these steps you are running into problem with, although if I were to guess, it's step 2. Do you have an oscilloscope? A multimeter? A logic analyzer? A LED on a piece of wire? These are all good debugging tools to verify that signals are what they're supposed to be.