Sunday, December 7, 2014

Displaying Numbers on 7-Segment Display using 8051 Microcontroller

https://www.facebook.com/RSElectronicsOfficial

The 7-segment displays is the basic electronic displays, which are used in many systems to display the numeric information. It consists of eight LEDs which are connected in sequential manner so as to display digits from 0 to 9, when proper combinations of LEDs are switched on. They can display only one digit at a time.
CODE:
#include<reg51.h>
sbit a= P3^0;
sbit b= P3^1;
sbit c= P3^2;
sbit d= P3^3;
void main()
{
unsignedchar n[10]={0×40,0xF9,0×24,0×30,0×19,0×12,0×02,0xF8,0xE00,0×10};
unsigned inti,j;
a=b=c=d=1;
while(1)
{
for(i=0;i{
P2=n[i];
for(j=0;j}
}
}

https://www.facebook.com/notes/rs-electronics/displaying-numbers-on-7-segment-display-using-8051-microcontroller/707542235988907