Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass
Created April 12, 2020 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeffersGlass/92c4782010eb1ab9c8edca681750474a to your computer and use it in GitHub Desktop.
Save JeffersGlass/92c4782010eb1ab9c8edca681750474a to your computer and use it in GitHub Desktop.
int SEG_A = 4; //define which pins connect to which segments
int SEG_B = 5;
int SEG_C = 8;
int SEG_D = 7;
int SEG_E = 6;
int SEG_F = 3;
int SEG_G = 2;
int SEG_DOT = 9;
int pins[] = {SEG_A, SEG_B, SEG_C, SEG_D, SEG_E, SEG_F, SEG_G, SEG_DOT};
int numPins = 8;
int pause = 500;
void setup() {
// put your setup code here, to run once:
for (int i = 0; i < numPins; i++){
pinMode(pins[i], OUTPUT);
digitalWrite(pins[i], HIGH);
}
}
void loop() {
// put your main code here, to run repeatedly:
for (int i = 0; i < numPins; i++){
digitalWrite(pins[i], LOW);
delay(pause);
digitalWrite(pins[i], HIGH);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment