Created
January 1, 2016 12:59
-
-
Save omarayad1/c3a070c0d1a1f67878e0 to your computer and use it in GitHub Desktop.
This file contains 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 curr = 0; | |
void setup() { | |
for (int i=0; i<5; i++){ | |
pinMode(i, OUTPUT); | |
} | |
digitalWrite(4, HIGH); | |
delay(5000); | |
} | |
void loop() { | |
digitalWrite(4, LOW); | |
digitalWrite (0, HIGH && (curr & B00001000)); | |
digitalWrite (1, HIGH && (curr & B00000100)); | |
digitalWrite (2, HIGH && (curr & B00000010)); | |
digitalWrite (3, HIGH && (curr & B00000001)); | |
curr += 1; | |
curr = curr % 10; | |
delay(1000); | |
digitalWrite(4, HIGH); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment