Any advice on how to get a more "industrial" version of this board, to be able to move bigger loads without eventually frying the chips?
I noticed that the motor drivers were *not* getting warm (at least warm enough for me to sense with my finger), even though they were (I think) supplying much more than 1 amp. (My power supply indicated it was supplying more than 5 Amps at 4.5 Volts when I ran the stepper from the scanner, which was not attached to the scanner belt; i.e. the motor was under very little load.)
I'll spend some more time trying to figure why the servo was not working, I have had success driving servos straight from the Arduino in the past, but have had jitter/stability issues.
Thanks in advance for your help.
"Motor party" code is here:
Code: Select all
// Adafruit Motor shield library
// copyright Adafruit Industries LLC, 2009
// this code is public domain, enjoy!
#include <AFMotor.h>
#include <Servo.h>
// DC motor on M2
AF_DCMotor motor(2);
// DC hobby servo
Servo servo1;
// Stepper motor on M3+M4 48 steps per revolution
AF_Stepper stepper(48, 2);
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Motor party!");
// turn on servo
servo1.attach(9);
// turn on motor #2
motor.setSpeed(200);
motor.run(RELEASE);
}
int i;
// Test the DC motor, stepper and servo ALL AT ONCE!
void loop() {
motor.run(FORWARD);
for (i=0; i<255; i++) {
servo1.write(i);
motor.setSpeed(i);
stepper.step(1, FORWARD, INTERLEAVE);
delay(3);
}
for (i=255; i!=0; i--) {
servo1.write(i-255);
motor.setSpeed(i);
stepper.step(1, BACKWARD, INTERLEAVE);
delay(3);
}
motor.run(BACKWARD);
for (i=0; i<255; i++) {
servo1.write(i);
motor.setSpeed(i);
delay(3);
stepper.step(1, FORWARD, DOUBLE);
}
for (i=255; i!=0; i--) {
servo1.write(i-255);
motor.setSpeed(i);
stepper.step(1, BACKWARD, DOUBLE);
delay(3);
}
}