The sample code provided compiles fine, but not even following the datasheet wiring diagram for steppers produced any output which may or may not indicate a faulty shield
This was the code for steppers:
#include <ShiftStepper.h>
#define DATPIN 13
#define SCLPIN 12
#define LATPIN 7
#define MRPIN 8
#define INDPIN 2
// Set up the step sequence for a random motor...
static const uint8_t stepSequence[4] = {0x2, 0x4, 0x1, 0x8};
// Set up channel combinations for the motors...
static const uint8_t motChans0[__channelsPerMotor__] = {0,2,3,1};
static const uint8_t motChans1[__channelsPerMotor__] = {4,5,6,7};
static const uint8_t motChans2[__channelsPerMotor__] = {11,9,10,8};
static const uint8_t motChans3[__channelsPerMotor__] = {15,14,13,12};
// Declare some required globals
shiftChain *myChain = 0; // initializes so everyone can see it, but doesn't call the constructor
shiftStepMotor motor0(__channelsPerMotor__, stepSequence, motChans0);
shiftStepMotor motor1(__channelsPerMotor__, stepSequence, motChans1);
shiftStepMotor motor2(__channelsPerMotor__, stepSequence, motChans2);
shiftStepMotor motor3(__channelsPerMotor__, stepSequence, motChans3);
shiftDevice *motors[4] = {&motor0, &motor1, &motor2, &motor3};
shiftSixteen board0(4, motors);
shiftBoard *boards[1] = {&board0};
shiftChain storeChain(1, boards, DATPIN, SCLPIN, LATPIN, MRPIN, INDPIN);
/* ISR functions to shift it all out */
ISR (TIMER2_OVF_vect)
{
myChain->doTick();
}
void setup (void)
{
myChain = &storeChain;
Serial.begin(57600);
Serial.println("I live!");
myChain->startTimer(__preScaler32__, 0, 2);
Serial.println("Timer started");
((shiftStepMotor*)myChain->getBoard(0)->getDev(0))->doSteps(-1,1); // set motor for continuous rotation
((shiftStepMotor*)myChain->getBoard(0)->getDev(1))->doSteps(-1,-1); // set motor for continuous rotation
((shiftStepMotor*)myChain->getBoard(0)->getDev(2))->doSteps(-1,1); // set motor for continuous rotation
((shiftStepMotor*)myChain->getBoard(0)->getDev(3))->doSteps(-1,-1); // set motor for continuous rotation
}
void loop (void) {
char in = 0; // input character
static int16_t speedSetting = 1; // speed
if (Serial.available() > 0) {
in = Serial.read();
switch (in) {
case '+':
speedSetting++;
((shiftStepMotor*)myChain->getBoard(0)->getDev(0))->setSpeed(speedSetting);
((shiftStepMotor*)myChain->getBoard(0)->getDev(1))->setSpeed(-speedSetting);
((shiftStepMotor*)myChain->getBoard(0)->getDev(2))->setSpeed(speedSetting);
((shiftStepMotor*)myChain->getBoard(0)->getDev(3))->setSpeed(-speedSetting);
Serial.print("Speed setting: ");
Serial.print(speedSetting, DEC);
Serial.print(" Forward speed: ");
Serial.print(((shiftStepMotor*)myChain->getBoard(0)->getDev(0))->getSpeed(), DEC);
Serial.print(" Reverse speed: ");
Serial.println(((shiftStepMotor*)myChain->getBoard(0)->getDev(1))->getSpeed(), DEC);
break;
case '-':
speedSetting--;
((shiftStepMotor*)myChain->getBoard(0)->getDev(0))->setSpeed(speedSetting);
((shiftStepMotor*)myChain->getBoard(0)->getDev(1))->setSpeed(-speedSetting);
((shiftStepMotor*)myChain->getBoard(0)->getDev(2))->setSpeed(speedSetting);
((shiftStepMotor*)myChain->getBoard(0)->getDev(3))->setSpeed(-speedSetting);
Serial.print("Speed setting: ");
Serial.print(speedSetting, DEC);
Serial.print(" Forward speed: ");
Serial.print(((shiftStepMotor*)myChain->getBoard(0)->getDev(0))->getSpeed(), DEC);
Serial.print(" Reverse speed: ");
Serial.println(((shiftStepMotor*)myChain->getBoard(0)->getDev(1))->getSpeed(), DEC);
break;
}
}
delay(10);
}
as per controlling the dc motors via arduino i was just suggested either using a dual chip h-bridge (which I am not sure i could get one that would allow the peak to go up to 4A or close to that value) or a transistor.
I have never worked with transistors but can anyone recommend one that would work for me? I did a bit of research and came across this one
http://www.fairchildsemi.com/ds/TI/TIP120.pdf
but might as well ask! thanks