Skip to content

Instantly share code, notes, and snippets.

@mrizvic
Last active September 4, 2015 22:55
Show Gist options
  • Save mrizvic/20d3d545685dcd4dc046 to your computer and use it in GitHub Desktop.
Save mrizvic/20d3d545685dcd4dc046 to your computer and use it in GitHub Desktop.
byte muxCount = 0;
byte mask[16]={113,114,116,120,177,178,180,184,209,210,212,216,225,226,228,232};
byte ledSegments1[]={0,0,1,1,0,1,0,1,0,1,0,1,1,0,0,1};
void displayRing(byte input[]) {
if (input[muxCount]) { PORTD = mask[muxCount]; } else { PORTD = 0; }
muxCount = ++muxCount % 16;
}
void setup() {
DDRD = B11111111; // sets Arduino pins 0 to 7 as outputs
}
void loop() {
displayRing(ledSegments1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment