Skip to content

Instantly share code, notes, and snippets.

Created September 24, 2017 19:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/f556f387d90c6a5bbebaa4b57aebbc00 to your computer and use it in GitHub Desktop.
Save anonymous/f556f387d90c6a5bbebaa4b57aebbc00 to your computer and use it in GitHub Desktop.
Stepper Motor
int x=800;
void setup() {
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
}
void loop() {
for(int j=0; j<3000; j++) {
for(int i=0; i<5; i++) {
digitalWrite(2, HIGH);
delayMicroseconds(x);
digitalWrite(2, LOW);
// delayMicroseconds(x);
}
if(x>85) x--;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment