Skip to content

Instantly share code, notes, and snippets.

/Winder Sketch Secret

Created September 16, 2017 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/840971fedeb23be75ffd45690f91e1ca to your computer and use it in GitHub Desktop.
Save anonymous/840971fedeb23be75ffd45690f91e1ca to your computer and use it in GitHub Desktop.
#include <CustomStepper.h>
CustomStepper stepper(1, 2, 3, 4, (byte[]){8, B1000, B1100, B0100, B0110, B0010, B0011, B0001, B1001}, 4075.7728395, 12, CW);
boolean rotate1 = false;
boolean rotatedeg = false;
boolean crotate = false;
void setup()
{
stepper.setRPM(12);
stepper.setSPR(4075.7728395);
}
void loop()
{
if (stepper.isDone() && rotate1 == false)
{
stepper.setDirection(CCW);
stepper.rotateDegrees(360);
rotate1 = true;
}
if (stepper.isDone() && rotate1 == true)
{
stepper.setDirection(CW);
stepper.rotateDegrees(360);
rotate1 = false;
}
stepper.run();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment