Created
August 23, 2019 15:59
-
-
Save samirsogay/991402247b7f0f74d617230249c97753 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 A = D1; //EN1 | |
int B = D2; //EN2 | |
int C = D3; //IN1 | |
int D = D4; //IN3 | |
long del = 15000; | |
void setup() { | |
pinMode(A, OUTPUT); | |
pinMode(B, OUTPUT); | |
pinMode(C, OUTPUT); | |
pinMode(D, OUTPUT); | |
digitalWrite(A, HIGH); | |
digitalWrite(B, HIGH); | |
} | |
void one(){ | |
digitalWrite(C, LOW); | |
digitalWrite(D, HIGH); | |
delayMicroseconds(del); | |
} | |
void two(){ | |
digitalWrite(C, LOW); | |
digitalWrite(D, LOW); | |
delayMicroseconds(del); | |
} | |
void three(){ | |
digitalWrite(C, HIGH); | |
digitalWrite(D, LOW); | |
delayMicroseconds(del); | |
} | |
void four(){ | |
digitalWrite(C, HIGH); | |
digitalWrite(D, HIGH); | |
delayMicroseconds(del); | |
} | |
// the loop routine runs over and over again forever: | |
void loop() { | |
for (int i=0; i<=500; i++){ | |
one(); | |
two(); | |
three(); | |
four(); | |
} | |
// delay(2000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment