I bought 2 h-bridges on ebay with some great specs i think, but now i can't seem to make it work.
https://www.ebay.com/itm/262935601988
this is the sketch i'm using.
int forward = 8; // forward direction pin
int reverse = 9; //reverse direction pin
int pwm = 10; //brake/pwm pin
void setup()
{
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
}
void loop()
{
digitalWrite(forward, HIGH);
digitalWrite(reverse, LOW);
for (int i=0; i <= 240; i++)
{
analogWrite(pwm, i);
delay(50);
}
delay(1000);
digitalWrite(forward, LOW);
digitalWrite(reverse, HIGH);
for (int i=0; i <= 240; i++)
{
analogWrite(pwm, i);
delay(50);
}
delay(1000);
}
but now the motor does not speed up properly and reverses before the arduino code does.
in the pdf are examples for the wiring, i used the last one. and set the dip switches all to on.
further i set the potentiometers for current limiting etc.. to max.
In the first example the forward/reverse switch is conntected to ground. but how do i do that with an arduino. can i pull these pins to gound?