Skip to content

Instantly share code, notes, and snippets.

@capsulecorplab
Last active July 23, 2022 22:13
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 capsulecorplab/6f0478b6afb577e2e36a92e39dd4ec7c to your computer and use it in GitHub Desktop.
Save capsulecorplab/6f0478b6afb577e2e36a92e39dd4ec7c to your computer and use it in GitHub Desktop.
Arduino sketch for running clockdrive with DRV8825 on Nema17 stepper motor on CG-4 mount
// Define pin connections & motor's steps per revolution
const int dirPin = 2;
const int stepPin = 3;
const int stepsPerRevolution = 200;
void setup()
{
// Declare pins as Outputs
pinMode(stepPin, OUTPUT);
pinMode(dirPin, OUTPUT);
// Set motor direction clockwise
digitalWrite(dirPin, HIGH);
}
void loop()
{
digitalWrite(stepPin, HIGH);
delay(53);
digitalWrite(stepPin, LOW);
delay(53);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment