I use the library by downloading the link: Motor Shield - Arduino motor/stepper/servo control
When you run the motor test (for example from the library), the command does not work
"FORWARD, BACKWARD and RELEAS"
If istolzovat this code, everything works:
int pwm_a = 3; / / PWM control for motor outputs 1 and 2 is on digital pin 3 (or 5,6)
int pwm_b = 11; / / PWM control for motor outputs 3 and 4 is on digital pin 9 (or 10,11)
int dir_a = 12; / / direction control for motor outputs 1 and 2 is on digital pin 2 (or 4,7)
int dir_b = 13; / / direction control for motor outputs 3 and 4 is on digital pin 8 (or 12,13)
void setup ()
{
pinMode (pwm_a, OUTPUT); / / Set control pins to be outputs
pinMode (pwm_b, OUTPUT);
pinMode (dir_a, OUTPUT);
pinMode (dir_b, OUTPUT);
analogWrite (pwm_a, 50); / / set both motors to run at (100/255 = 39)% duty cycle (slow)
analogWrite (pwm_b, 50);
}
void loop ()
{
digitalWrite (dir_a, LOW); / / Set motor direction, a low, 2 high
digitalWrite (dir_b, LOW); / / Set motor direction, three high, four low
delay (1000);
analogWrite (pwm_a, 50); / / set both motors to run at 100% duty cycle (fast)
analogWrite (pwm_b, 50);
delay (1000);
digitalWrite (dir_a, HIGH); / / Reverse motor direction, one high, two low
digitalWrite (dir_b, HIGH); / / Reverse motor direction, three low, four high
delay (1000);
analogWrite (pwm_a, 100); / / set both motors to run at (100/255 = 39)% duty cycle
analogWrite (pwm_b, 100);
delay (1000);
}
What and where you want to change the library or where you can download right?