Created
July 8, 2019 08:10
-
-
Save surinoel/8e2a3a78b706c4d04f3aa3f1fbab2cbd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
uint8_t aFndData[16] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x27, | |
0x7F, 0x6F, 0x77, 0x7C, 0x39, 0x5E, 0x79, 0x71}; | |
uint8_t aFndSelData[6] = {0x3E, 0x3D, 0x3B, 0x37, 0x2F, 0x1F}; | |
int aPinFndData[8] = {13, 12, 11, 10, 9, 8, 7, 6}; | |
int aPinFndSel[6] = {5, 4, 3, 2, 1, 0}; | |
void setup() { | |
// put your setup code here, to run once: | |
for(int i=0; i<8; i++) { | |
pinMode(aPinFndData[i], OUTPUT); | |
} | |
for(int i=0; i<6; i++) { | |
pinMode(aPinFndSel[i], OUTPUT); | |
} | |
} | |
void loop() { | |
for(int k=0; k<6; k++) { | |
fndSelOut(aFndSelData[k]); | |
for(int i=0; i<16; i++) { | |
fndDataOut(aFndData[i]); | |
delay(200); | |
} | |
} | |
} | |
void fndDataOut(uint8_t data) { | |
for(int i=0; i<8; i++) { | |
digitalWrite(aPinFndData[i], (data >> i) & 0x01); | |
} | |
} | |
void fndSelOut(uint8_t data) { | |
for(int i=0; i<6; i++) { | |
digitalWrite(aPinFndSel[i], (data >> i) & 0x01); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment