[ SOLVED ] need help on using Ibt_2 (BTs7960 based driver)

void setup() {
  pinMode(12, OUTPUT); //rpwm
  pinMode(13, OUTPUT); //Lpwm
  pinMode(22, OUTPUT); //L_en
  pinMode(23, OUTPUT); //R_en


  digitalWrite(22, HIGH); //setting L_en high
  digitalWrite(23, HIGH); //setting R_en high

}

void loop() {
digitalWrite(12,HIGH);//setting rpwm high
digitalWrite(13,LOW);//setting Lpwm LOW
delay(2000);
digitalWrite(12,LOW); //setting rpwm low
delay(2000);
digitalWrite(13,HIGH); //setting Lpwm high
delay(2000);
}

I am using the above mentioned code to try and move the motor in both the directions.
I am not able to figure out how the driver works actually.

this is the driver I am using:https://robokits.co.in/motor-drives-drivers/bts7960-high-power-driver-module-43a?cPath=73_110&

what are the changes I need to make to make the motor move in both forwards and reverse direction?

okay I got the program working with one little change.

I swapped both rpwm and Lpwm with L_en and R_en pins position.

direction controlling using the L_en and R_en pins.

To moderators-"please mark this one as solved"

hardik_khatri:
To moderators-"please mark this one as solved"

Just put "solved" in title of your opening post.

thank you elvon :slight_smile:

hardik_khatri:
okay I got the program working with one little change.

I swapped both rpwm and Lpwm with L_en and R_en pins position.

direction controlling using the L_en and R_en pins.

To moderators-"please mark this one as solved"

Yes, enabling both L_en and R_en as in your first attempt will just cause active braking!