Hi, my aim is to just control the direction and speed of the Micro-Metal Gearmotor with this motor driver DRV8801.
For now my code is
int PWM1= 2;
int DIR1= 22;
int Brake1= 28;
void setup() {
pinMode(PWM1, OUTPUT);
pinMode(DIR1, OUTPUT);
pinMode(Brake1,OUTPUT);
digitalWrite(DIR1, LOW);
}
void loop() {
analogWrite(PWM1, 200);
delay(2000);
digitalWrite(DIR1, HIGH);
analogWrite(PWM1, 50);
}
But the motor is neither changing direction nor speed. What am I doing wrong?