I have l298n motor driver that connects into two DC motors. Motor A rotate forward and backward nicely, but Motor B rotate forward only. My problem is why Motor B can not rotate backward? I check my wirings and codes, then I think they correct. Does my l298n driver is defective? Thanks.
Looks like maybe you should have:
in place of:
Thank you very much sir, for the reply.
I tried to apply the code below,
but still motor B does not rotate backward.
I observe the red LED lights in l298n driver, they are properly switching in pattern to the source codes but the motor B does not respond still.
any further suggestion sir. thanks.
Could you send a picture of your setup, or a wiring diagram? I am currently using one of these motor drivers and have mine working well.
Attached is the wiring diagram.
Sorry for the design of the picture sir.
Swap motors to discern whether the problem is the motor or the driver.
Your wiring seems to all be correct. Make sure also that you have a common ground between your arduino and your motor controller; this just means that you have to connect the two together. Also assuming that you are using one of the prebuilt L298N motor controller boards make sure you still have the jumper right above the power plugs in place.
Follow Artic_Eddie's advice first and see if the issue persists with the motor. If the issue then occurs on the other motor it is either the code or it is controller, if the issue happens on the same motor then it is the motor that is causing the issues.
ok sir, i will do trial and error.
thank you very much for the help sir.