7-Segment Display Interfacing With Avr Atmega16
7-Segment Display Interfacing With Avr Atmega16
7-segment displays are made up of 8 LED segments. 7 of these LED segments are in the shape of
a line, whereas 1 segment is circular.
The 7 line-shaped LED segments are used for displaying numbers 0 to 9 and a few letters like A,
c, d, e, F, H, L, O, P, U, etc. The circular segment is used for displaying a decimal point.
Each of the 8 elements has a pin associated with it which can be driven HIGH or LOW according
to the type of display and the number or alphabet to be displayed.
The common anode and common cathode types are available in a 7-segment display. Depending
on which type is used, the control signal required to light up a segment in the display changes.
Common anode requires a LOW signal whereas common cathode requires a HIGH signal to light
up a segment.
int main(void)
{
char array[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90};
/* write hex value for CA display from 0 to 9 */
while(1)
{
for(int i=0;i<10;i++)
{