Last active
July 23, 2022 22:13
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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