Level 1
Make an Arduino project counting numbers from 0 to F slowly and showing them on 7 segment indicator. After F you go back to 0.
Level 2
The same, but use all 4 digits to count and show as big number as you can fit in 4 hex digits.
assigment - 7 segment indicator
Re: assigment - 7 segment indicator
4 Digit 7 Segment display, display things by only displaying one digit at a time in one place so 1234 the one will be displayed and the other spots turned off then 2 will turn on on the second spot and the rest turned off and so on and set forth. The reason this works is because it goes so fast the human eyes cannot catch it, it refreshes much faster than our eyes.
- Attachments
-
- the letters are the segments dp is the decimal point and the d's with numbers are the digits
- 4_digit_7_segment_display.png (88.04 KiB) Viewed 121549 times
Class For Characters
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
};
};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.