Code: Select all
class Characters {
public:
int sA = 6;
int sB = 2;
int sC = 10;
int sD = 12;
int sE = 13;
int sF = 5;
int sG = 9;
int d1 = 7;
int d2 = 4;
int d3 = 3;
int d4 = 8;
int p = 11;
int c0[7] = { 6, sA, sB, sC, sD, sE, sF };
int c1[3] = { 2, sB, sC };
int c2[6] = { 5, sA, sB, sG, sD, sE };
int c3[6] = { 5, sA, sB, sC, sD, sG };
int c4[5] = { 4, sF, sB, sG, sC };
int c5[6] = { 5, sA, sF, sG, sD, sC };
int c6[7] = { 6, sA, sF, sG, sD, sE, sC };
int c7[4] = { 3, sA, sB, sC };
int c8[8] = { 7, sA, sB, sC, sD, sE, sF, sG };
int c9[6] = { 5, sA, sB, sG, sF, sC };
int cA[7] = { 6, sA, sB, sC, sG, sF, sE };
int cB[6] = { 5, sG, sE, sC, sD, sF };
int cC[5] = { 4, sA, sF, sE, sD };
int cD[6] = { 5, sB, sG, sD, sE, sC };
int cE[7] = { 6, sA, sG, sE, sF, sD };
int cF[6] = { 5, sA, sG, sF, sE };
int hexDigits[16]{
c0,c1,c2,c3,
c4,c5,c6,c7,
c8,c9,cA,cB,
cC,cD,cE,cF
};
};
if anyone wants to use this code to keep track of characters and such they can.
however you have to use the chart of the 4 digit 7 segment display because it only works according to that chart, and will only work for 4 digit displays. If you use this chart its pretty easy the s with a letter after are the segments the d's with numbers after are digits and the p is decimal point that is the code the numbers they correspond to are the pins you need to plug them into. If needed you can modify the segment digit and decimal point variables to be the pin numbers of your setup. The characters themselves actually consist of the first index the number of pins/segments used, and the rest are the segments required to make this character, once again you can modify the segment variables to be adjusetd to your pin layout.