From 50741adbc4a8de96be901598fdfff7cbb5ca0eb2 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Mon, 27 Mar 2023 12:33:14 -0400 Subject: [PATCH] Add a README and an example --- README.md | 40 ++++++++++++++++++++++++ examples/dual_steppers/dual_steppers.ino | 22 +++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 README.md create mode 100644 examples/dual_steppers/dual_steppers.ino diff --git a/README.md b/README.md new file mode 100644 index 0000000..80d4c96 --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# ITEAD Studio + +This is an experimental Arduino library for controlling two stepper motors using the ITEAD Studio dual stepper motor driver shield. + +Currently limited to supporting bipolar NEMA17 motors. + + +## Example + +```cpp +#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); +} +``` + + +## Links + +[Banana Robotics - Dual Stepper Motor Driver Shield for Arduino](https://www.bananarobotics.com/shop/ITEAD-Dual-Stepper-Motor-Driver-Shield) + +[ITEAD Wiki - Arduino Dual Step Motor Driver Shield](https://wiki.iteadstudio.com/Arduino_Dual_Step_Motor_Driver_Shield) \ No newline at end of file diff --git a/examples/dual_steppers/dual_steppers.ino b/examples/dual_steppers/dual_steppers.ino new file mode 100644 index 0000000..6728107 --- /dev/null +++ b/examples/dual_steppers/dual_steppers.ino @@ -0,0 +1,22 @@ +#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); +} \ No newline at end of file