It's hard to say what the problem is without a clear picture of your wiring and your code.
For starters:
Did you check for loose connections?
Are you connecting what you think you are connecting? (enable B vs enable A, mixing up digital pins, ect.)
Do you have proper and correct variable initialization?
Do you have a proper setup() defining the correct pins the correct pinMode?
Is your code getting stuck in a loop somewhere?
Is your power source sufficient?