Created
December 19, 2020 12:36
-
-
Save makerstorage/a38461d647636f313d5a69e8f08300c6 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
| int dirPin= 8; | |
| int stepPin = 9 ; | |
| void setup() { | |
| pinMode(dirPin, OUTPUT); | |
| pinMode(stepPin, OUTPUT); | |
| attachInterrupt(0,kesme,RISING); | |
| Serial.begin(9600); | |
| digitalWrite(dirPin,HIGH); | |
| } | |
| void kesme() | |
| { | |
| digitalWrite(dirPin, !digitalRead(dirPin)); | |
| } | |
| void loop() { | |
| for(int i = 0 ; i<200;i++){ | |
| digitalWrite(stepPin, HIGH); | |
| delayMicroseconds(1500); | |
| digitalWrite(stepPin, LOW); | |
| delayMicroseconds(1500); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment