Hi, So I have the BTS7960B Motor Driver connected to the arduino and it is not working at all we have tried searching online for a code that might make it work but nothing. This is the code we are currently using.
// Arduino code for the H_BRIDGE
int LPWM = 9; // H-bridge leg 1 ->LPWM
int enL = 8; // H-bridge enable pin 1 -> L_EN
int RPWM = 6; // H-bridge leg 2 ->RPWM
int enR = 9; // H-bridge enable pin 2 -> R_EN
void setup()
{
Serial.begin (9600);
pinMode(LPWM, OUTPUT);
pinMode(RPWM, OUTPUT);
pinMode(enL, OUTPUT);
pinMode(enR, OUTPUT);
digitalWrite(enL, HIGH);
digitalWrite(enR, HIGH);
}
void loop()
{
analogWrite(RPWM,100); //pwm value
digitalWrite(LPWM, LOW);
}
We connected 9.6V to VCC and Ground. Please if anyone can help this is for a school project. All we want to see right now is that the motor driver isnt defective so any code that will make one of the motors move will be perfect.