
- #Proteus 7 segment common cathode display code how to
- #Proteus 7 segment common cathode display code code
define name to each control signal for 7-segment
#Proteus 7 segment common cathode display code how to
If you have no idea about MikroC and if you don’t know how to create a project with this compiler, you can read this post:

#Proteus 7 segment common cathode display code code
This is a complete code to print ADC value on a 4-digit seven-segment display in Mikroc for Pic compiler. Now, if we rotate the knob of POT according to increasing or decreasing resistance terminal, voltage also rise or fall on analog input pin (AN0). Connect one terminal with positive terminal of 5 volts, other terminal with ground and center terminal with ADC pin of PIC16F877A microcontroller. To provide, the analog voltage input to ADC channel AN0, we connected a variable resistor ( which is also known as POT ) to this pin.Ī potentiometer is a three terminal passive electronics device. In order to make a practical demonstration for displaying ADC value on seven segment display, we used one analog to digital converter channel ( AN0/RA0) of PIC16F877A microcontroller. This table shows the connections of PORTD of PIC16F877A microcontroller with A-G pins of the seven-segment device through 330ohm resistors. Make connections of PORTB with control pins according to this table. Also RB0, RB1, RB2, RB4 pins to control each 7-segment from out of four.

This configuration will result in the display as shown in the figure below.ĭigit 5: to display the digit 5 we need to turn on the segments a, c, d, f, g. This configuration will result in the display as shown in the figure below.ĭigit 4: to display the digit 4 we need to turn on the segments b, c, f, g. This configuration will result in the display as shown in the figure below.ĭigit 3: to display the digit 3 we need to turn on the segments a, b, c, d, g. Related article: MUX – Digital Multiplexer | Types, Construction & Applicationsĭigit 2: to display the digit 2 we need to turn on the segments a, b, d, e, g. This configuration will result in the display as shown in the figure below. and turn off the LED segments a, d, e, f, and g. which would look like the figure given below.ħ-Segment Display Segments for all Numbersĭisplay combination of decimal numbers is given below.ĭigit 1: to display the digit 1 we need to turn on the segments b, c.

Suppose we want to display digit ‘0’, in order to display 0, we need to turn on “a”, “b”, “c”, “d”, “e”, “f”. We assume common cathode LED segment as our example. Each of the pins will illuminate the specific segment only. Working of 7-Segment Display (LED & LCD) Circuitħ LED segments of the display and their pins are “ a”, “b”, “c”, “d”, “e”, “f” & “g” as shown in the figure given below.

In such type of 7-segment display, all the cathodes of the 7 LEDs are connected together to form a common terminal. There are two types of 7-Segment displays.
