hey,
i have 2 steppers both of them runs perfect single control (a code 1 stepper, similar following code). don't run @ same time, because 1 of them more steppes (he runs unround). think problem in code can't find it.
fabscan shield (http://www.watterott.com/de/arduino-fabscan-shield)
a4988-driver (http://www.watterott.com/de/pololu-a4988-schrittmotortreiber)
- limited 800mv
arduino uno
stepper motor: bipolar, 200 steps/rev, 20×30mm, 3.9v, 0.6 a/phase (https://www.pololu.com/product/1204)
i have 2 steppers both of them runs perfect single control (a code 1 stepper, similar following code). don't run @ same time, because 1 of them more steppes (he runs unround). think problem in code can't find it.
fabscan shield (http://www.watterott.com/de/arduino-fabscan-shield)
a4988-driver (http://www.watterott.com/de/pololu-a4988-schrittmotortreiber)
- limited 800mv
arduino uno
stepper motor: bipolar, 200 steps/rev, 20×30mm, 3.9v, 0.6 a/phase (https://www.pololu.com/product/1204)
code: [select]
int enpin = 5;
int steppin = 6;
int dirpin = 7;
int enpinl = 2;
int steppinl = 3;
int dirpinl = 4;
void setup() {
pinmode(enpin,output);
pinmode(steppin,output);
pinmode(dirpin,output);
digitalwrite(enpin,low); // en muss auf low= 0-> eingschalten
pinmode(enpinl,output);
pinmode(steppinl,output);
pinmode(dirpinl,output);
digitalwrite(enpinl,low); // en muss auf low= 0-> eingschalten
}
void loop() {
digitalwrite(dirpin,high); //richtung festlegen
digitalwrite(dirpinl,high);
for( int = 0; < 200;i++){
digitalwrite(steppin,high);
delay(10);
digitalwrite(steppinl,high);
delay(10);
digitalwrite(steppin,low);
delay(10);
digitalwrite(steppinl,low);
delay(10);
}
delay(1000);
}
it's delays(). delays evil, arduino can 1 one thing @ time delay tell arduino sit , nothing.
Arduino Forum > Using Arduino > General Electronics > 2 stepper don't running together
arduino
Comments
Post a Comment