Created
January 10, 2016 16:52
-
-
Save Miceuz/252414f105a1b4eab6b2 to your computer and use it in GitHub Desktop.
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 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