Skip to content

Instantly share code, notes, and snippets.

@Miceuz
Created January 10, 2016 16:52
Show Gist options
  • Save Miceuz/252414f105a1b4eab6b2 to your computer and use it in GitHub Desktop.
Save Miceuz/252414f105a1b4eab6b2 to your computer and use it in GitHub Desktop.
#define STEP_X 49
#define DIR_X 51
#define ENA_X 53
#define STEP_Y 43
#define DIR_Y 45
#define ENA_Y 47
void setup() {
pinMode(STEP_X, OUTPUT);
pinMode(DIR_X, OUTPUT);
pinMode(ENA_X, OUTPUT);
digitalWrite(ENA_X, LOW);
}
void pulse() {
digitalWrite(STEP_X, HIGH);
delayMicroseconds(650);
// delay(1);
digitalWrite(STEP_X, LOW);
delayMicroseconds(650);
// delay(1);
}
void loop() {
uint32_t s = millis();
while(millis() - s < 15000) {
pulse();
}
delay(2000);
digitalWrite(DIR_X, !digitalRead(DIR_X));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment