I have a BTS7960 h-bridge and I am trying to make a motor to move forward and backward using pwm values. I am using the pi4j library to control the pins.
The pins L_EN and R_EN are initialized as DigitalOutputPins.
Case Study 1
When I am initializing all the R_PWM and L_PWM as DigitalOutputPins the motor can move forward and backward at full speed.
Case Study 2
When I am trying to initialize the R_PWM and L_PWM pins as PwmOutputPins the motor cannot move.
Case Study 3
When I am trying to initialize the R_PWM as DigitalOutputPin and L_PWM as PwmOutputPin the motor moves to one direction only.
It seems that this h-bridge does not work when pin is set to 0 using pwm but it works when pin is set to 0 in digital!
I wonder why this is happening.
If you need to check my source code please see here