Last active
September 3, 2015 12:49
-
-
Save mrizvic/c1462655f8b8adf52764 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
byte muxCount = 0; | |
byte lookup[17]={0,1,2,4,8,1,2,4,8,1,2,4,8,1,2,4,8}; | |
void displayRing(byte number) { | |
byte groupMin = (4 * muxCount) + 1; | |
byte groupMax = (4 * muxCount) + 4; | |
byte A = 0; | |
byte B = 0; | |
if (number > 0) { | |
if ( (number >= groupMin) && (number <= groupMax) ) { | |
A = lookup[number]; | |
B = 1 << muxCount; | |
} | |
} | |
byte PORT; | |
PORT = (B << 4) + A; | |
muxCount++; | |
muxCount = muxCount % 4; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment