Skip to content

Instantly share code, notes, and snippets.

@omarayad1
Created January 1, 2016 12:59
Show Gist options
  • Save omarayad1/c3a070c0d1a1f67878e0 to your computer and use it in GitHub Desktop.
Save omarayad1/c3a070c0d1a1f67878e0 to your computer and use it in GitHub Desktop.
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