#7381
Good morning, everyone:

Was wondering if you have any ideal how to control two steppers separately using two shields ?

I stacked two shields together and each shield links with a 28BYJ-48 stepper motor. Since the pin settings for the board are the same and all commands are sent to both shields, these two steppers working in the same manner. For example, they turn clockwise at the same time. My idea is to block one board from the other. When the commands have been sent, one board receives but one ignores the commands. How should I achieve this ?

I also need some suggestions for the sketch programming.

If you have other suggestions for controlling two steppers, for example, using other motor shield or connecting method, please also let me know. Thanks in advance.
#7383
HI

Are you using the Stepper Motor Shield,http://www.dfrobot.com/index.php?route=product/product&product_id=1060&search=step&description=true&category_id=48#.VYt7N_kQjj9this can be used to control two steper seprately :)

the code is from its wiki page:
Code: Select all
int M1dirpin = 4;
int M1steppin = 5;
int M2dirpin = 7;
int M2steppin = 6;
void setup()
{
  pinMode(M1dirpin,OUTPUT);
  pinMode(M1steppin,OUTPUT);
  pinMode(M2dirpin,OUTPUT);
  pinMode(M2steppin,OUTPUT);
}
void loop()
{
  int j;
  delayMicroseconds(2);
  digitalWrite(M1dirpin,LOW);
  digitalWrite(M2dirpin,LOW);
  for(j=0;j<=5000;j++){
    digitalWrite(M1steppin,LOW);
    digitalWrite(M2steppin,LOW);
    delayMicroseconds(2);
    digitalWrite(M1steppin,HIGH);
    digitalWrite(M2steppin,HIGH);
    delay(1);
  }
}
#7408
HI

I digged online and found some sueful article from arduino.cc. But I have no chance to play with this module:

Could you try this http://www.tigoe.net/pcomp/code/circuits/motors/stepper-motors/ linked from arduino.cc?

Hope to get any progress~ :)

woqisiyasi wrote:thanks for your reply. Unfortunately, not that one. I am using this one:

http://www.dfrobot.com/index.php?route=product/product&path=35_124&product_id=69#.VYuKL2MxpcU.