Hello All,
I want to control two dc motors with a VMA03 and an arduino.
I have stacked the VMA03 on top of the arduino and wired an external 12V dc power supply and DC motor to the VMA03 as shown below
I ran the standard code show bellow. The motor makes noise but doesn’t move, I believe that it may be getting power from the arduino instead of the external power source, but I don’t know how to fix this
int pwm_b = 9; //PWM control for motor outputs 3 and 4
int dir_b = 8; //direction control for motor outputs 3 and 4
void setup()
{
//Set control pins to be outputs
pinMode(pwm_b, OUTPUT);
pinMode(dir_b, OUTPUT);
//set both motors to run at (100/255 = 39)% duty cycle (slow)
analogWrite(pwm_b, 100);
}
void loop()
{
digitalWrite(dir_b, LOW);
analogWrite(pwm_a, 150);
analogWrite(pwm_b, 150);
delay (1000)
digitalWrite(dir_b, HIGH);
analogWrite(pwm_a, 150);
analogWrite(pwm_b, 150);
}