I started building one project for which i need to connect and control 6 stepper motors. at a time only one stepper motor will be working, but all motors should be connected. i need to use the motors in combinations like... 1st motor 90degrees clockwise then 4th motor 90degrees anticlockwise then 5th motor 90 degrees anticlockwise and so on. these rotation info is passed through my pc to arduino on by one using ide (i don't exactly know what it is).
what i want to do is, make a program which will be having 12 cases for 6 motors clockwise and anticlockwise. and when a particular alphabet is passed to arduino, that very motor rotates and the next alphabet is passed and respectively motor rotates.
i don't know haw to program an arduino, i got one program from this forum only, which was to rotate 1 stepper motor 1st clockwise then anticlockwise.
also i am using pololu a4988 driver board which has direction and step pins.
thanks in advance.
here is the code
// testing a stepper motor with a Pololu A4988 driver board
// on an Uno the onboard led will flash with each step
// as posted on Arduino Forum at http://forum.arduino.cc/index.php?topic=208905.0
byte directionPin = 9;
byte stepPin = 8;
int numberOfSteps = 50;
byte ledPin = 13;
int pulseWidthMicros = 50; // microseconds
int millisbetweenSteps = 50; // milliseconds
void setup()
{
Serial.begin(9600);
Serial.println("Starting StepperTest");
digitalWrite(ledPin, LOW);
delay(2000);
pinMode(directionPin, OUTPUT);
pinMode(stepPin, OUTPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(directionPin, HIGH);
for(int n = 0; n < numberOfSteps; n++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(pulseWidthMicros);
digitalWrite(stepPin, LOW);
delay(millisbetweenSteps);
digitalWrite(ledPin, !digitalRead(ledPin));
}
delay(3000);
digitalWrite(directionPin, LOW);
for(int n = 0; n < numberOfSteps; n++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(pulseWidthMicros);
digitalWrite(stepPin, LOW);
delay(millisbetweenSteps);
digitalWrite(ledPin, !digitalRead(ledPin));
}
}
void loop()
{
}