IteadStudioDualStepperShield/examples/dual_steppers/dual_steppers.ino

22 lines
400 B
C++

#include "IteadDualStepperShield.h"
IteadDualStepperShield mc;
void setup () {
mc.setup();
mc.setSpeed(0, 2000);
mc.setSpeed(1, 2000);
}
void loop () {
mc.setDir(0, 1);
mc.setDir(1, 1);
delay(50);
mc.stepBoth(200); // Run stepper in one direction
delay(500);
mc.setDir(0, 0);
mc.setDir(1, 0);
delay(50);
mc.stepBoth(200); // Run stepper in reverse direction
delay(500);
}