Devices & Components
Arduino Uno Rev3
Solderless Breadboard Full Size
Jumper wires (generic)
7 Segment LED Display, InfoVue
Shift Register- Serial to Parallel
Resistor 220 ohm
Software & Tools
Windows 10
Arduino IDE
Project description
Code
7 Segment Integrated Circuit Arduino Code
arduino
The code to run the project. Lots of //comments! Wiring details and a table!
1/* This expirement requires: 2 1x arduino (UNO) 3 1x integrated circuit ic74hc595 (IC7) 4 1x 7 segment common cathode display (SSD) 5 1X breadboard (BBD) 6 8x 220k resistors (RES) 7 a bunch x wires/jumpers 8 ++Scroll to bottom for wiring schematic++ 9 ++and lighting math table++ 10*/ 11 12int latchPin = 2; //tells IC7 to dump stored data to SSD (pin2 UNO > pin12 on the IC7) 13int dataPin = 3; //data from arduino to IC7 (pin3 UNO > pin14 IC7) 14int clockPin = 4; //clock from arduino to IC7 (pin4 UNO > pin11 IC7) 15 16/*The next line creates an array. 17 Basically, an array is a spreadsheet that has Cols, Rows and a dozen or more pages. 18 Note: The below table contains 18 characters, The index though starts at 0. 19 So the 16th character, (int upArray[16]) would return 127. 20 arRay[3][4][5] is a valid array. (arRay[0,1,2]) returns 1st Col, 2nd Row, 3rd Page. 21*/ 22 23const byte upArray[18] = {1, 2, 4, 8, 16, 32, 64, 128, 63, 6, 91, 79, 102, 109, 125, 7, 127, 111}; 24 25/* These numbers corrospond to the sum of the SSD's pin address. 26 For instance, the number 1 needs to supply a low signal to pins B and C. 27 Each pin is an increase of *2. pinA = 1, pinB = 2, PinC = 4, PinD = 8, PinE = 16 and so on. 28 So to display a 1 you will need to light up segmentB and segmentC = 2 + 4 = 6 29 6 will need to be send to the IC7 to tell it to display 1 on the SSD. 30 The "." (decimal) = pinPD or the 8th pin or 1*2*2*2*2*2*2*2 or 128. 31 2 lights up pins A, B, D, E & G. or 1 + 2 + 8, 16 & 64. So, send the sum 91. 32*/ 33 34void setup() { 35 Serial.begin(9600); //This sets up the UNO to send information to you're IDE's serial display 36 pinMode(latchPin, OUTPUT); //Sets your UNO pins to OUTPUTs from INPUTs (default) 37 pinMode(dataPin, OUTPUT); //You want to send data to the IC7, not receive data 38 pinMode(clockPin, OUTPUT); //like you would for, perhaps, a sensor. 39} 40 41void loop() { 42 for (int j = 0; j <= 17; j++) { //sets j to number 0; if j <= 17; increase j by 1 43 //do the stuff in the {brackets} 44 digitalWrite(latchPin, LOW); //remember, when the latch is HIGH, the IC7 is dumping data to the SSD 45 shiftOut(dataPin, clockPin, MSBFIRST, upArray[j]); //send data, your totals, from the UNO to the IC7 46 digitalWrite(latchPin, HIGH); //UNO tells IC7 to send the decoded totals to the SSD 47 Serial.println(upArray[j]); //Print (upArray[j]) to your IDE's serial display 48 delay(1000); //A 1 second delay, then check if j less than or equal to 17 again 49 } 50} 51 52/* blank = no connection 53 * <r> resistor between connections 54 SSD : RES : IC7 : UNO : BBD 55 --------------------------- 56 A : <r> : 15 : : 57 B : <r> : 1 : : 58 C : <r> : 2 : : 59 D : <r> : 3 : : 60 E : <r> : 4 : : 61 F : <r> : 5 : : 62 G : <r> : 6 : : 63 DP : <r> : 7 : : 64 GND: : : : GND 65 : : 8 : : GND 66 : : 9 : : : NOT USED 67 : : 10 : : +5V 68 : : 11 : 4 : 69 : : 12 : 2 : 70 : : 13 : : GND 71 : : 14 : 3 : 72 : : 16 : : +5V 73 : : : +5V : +5V 74 : : : GND : GND 75---------------------------------- 76Maths table: 77 |A|B|C|D| E| F| G| PD|ttl1 78 |1|2|4|8|16|32|64|128| 790|1|2|4|8|16|32| 0| 0|63 801|0|2|4|0| 0| 0| 0| 0|6 812|1|2|0|8|16| 0|64| 0|91 823|1|2|4|8| 0| 0|64| 0|79 834|0|2|4|0| 0|32|64| 0|102 845|1|0|4|8| 0|32|64| 0|109 856|1|0|4|8|16|32|64| 0|125 867|1|2|4|0| 0| 0| 0| 0|7 878|1|2|4|8|16|32|64| 0|127 889|1|2|4|8| 0|32|64| 0|111 89.|0|0|0|0| 0| 0| 0|128|128 90*/ 91
Downloadable files
7 Segment IC Circuit Schematic
Wiring Schematic for the 7 segment display (cathode common) Integrated Circuit project.
7 Segment IC Circuit Schematic

7 Segment IC Circuit Schematic
Wiring Schematic for the 7 segment display (cathode common) Integrated Circuit project.
7 Segment IC Circuit Schematic

Comments
Only logged in users can leave comments