Hi all,
I recieved an ardumoto yesterday and wired it up today. To test I ran the sample code from sparkfun. Ardumoto_test_3.pde.
12VDC 1A wall wart to the Ardumoto
USB 5V to Arduino
I am using the Tamiya twin motor gear box at the moment and the toy motor that came with an Arduino Inventors Kit to test.
When running the sketch with no load my LED’s indicating direction light up and appear to follow the code.
Blue LED on B while Yellow on A
Then Yellow on B while Blue on A.
No LED’s on the same channel are on at the same time.
When I put a load, either the Tamiya’s or the toy motor, I only get one direction and both leds will light up, one dimly the other brightly, and motors will turn in only one direction.
Does anyone have any ideas as to the direction I should take as to the issue? It seems to be shorting under load only. Let me know if I am missing any critical information, Working on checking current draws now.
Thanks
/*
10-5-10
Pete Dokter
SparkFun Electronics
This is an example sketch for Arduino that shows very basically how to control an Ardumoto
motor driver shield with a 5V Arduino controller board (3.3V may work, but it's out of spec
for the L298 H-bridge logic, so no promises). If you're plugging the Ardumoto into an
Arduino Duemilanove or similar, all the connections are done for you and you can just rewrite
the examples in this code to your liking.
Changed to reflect a new board revision...
*/
//int pwm_a = 10; //PWM control for motor outputs 1 and 2 is on digital pin 10
int pwm_a = 3; //PWM control for motor outputs 1 and 2 is on digital pin 3
int pwm_b = 11; //PWM control for motor outputs 3 and 4 is on digital pin 11
int dir_a = 12; //direction control for motor outputs 1 and 2 is on digital pin 12
int dir_b = 13; //direction control for motor outputs 3 and 4 is on digital pin 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, 100); //set both motors to run at (100/255 = 39)% duty cycle (slow)
analogWrite(pwm_b, 100);
}
void loop()
{
digitalWrite(dir_a, LOW); //Set motor direction, 1 low, 2 high
digitalWrite(dir_b, LOW); //Set motor direction, 3 high, 4 low
delay(1000);
analogWrite(pwm_a, 255); //set both motors to run at 100% duty cycle (fast)
analogWrite(pwm_b, 255);
delay(1000);
digitalWrite(dir_a, HIGH); //Reverse motor direction, 1 high, 2 low
digitalWrite(dir_b, HIGH); //Reverse motor direction, 3 low, 4 high
delay(1000);
analogWrite(pwm_a, 100); //set both motors to run at (100/255 = 39)% duty cycle
analogWrite(pwm_b, 100);
delay(1000);
}