Why have you got this line in loop()
digitalWrite(enb, LOW);
and its counterpart?
Well, for me, there were 3 reasons,
-
Why keep the coil's energized and make it draw power all the time? (In my finished product, I would be having atleast three of these motors)
-
When I was Enabling the driver, I could see switching noise in the A1, A2, B1, B2 coils(in a custom PCB which I made) even when there was no step signal provided.(Although it wasnt causing any motion) when I observed it through a logic analyser. (One other possibility was that it might have been due to noise coupling between the multiple channels in the logic analyser, well thats to be figured out for an another day)
-
Well, Datasheet gives me the option to do so, hence why shouldn't I utilize it, was my thought. I was following the timing diagram in DRV8825 for the enable pin.(Page 7 of datasheet)