Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

led and 7 segment program parallel

Status
Not open for further replies.

suga

Member level 2
Joined
Jan 23, 2012
Messages
49
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
chennai
Activity points
1,596
I wrote a program counter for led and 7 segment.at a time both has to run.but 7 segment started run after that led started.
here c1,c2 as a switch.

This is my program

Code:
#include<reg51.H>
unsigned int t,i;
#define p0 P0
#define p3 P3
#define p1 P1    
sbit c1=p3^2;
sbit c2=p3^3;
void led();
void segment();
void wait (int j)  {                      
 long int  d;

  for(d =0;d<j;d++);          
}
void main()
{	
if(c2==1)
{
 segment();
 
 led();
 
}
}
void segment()
{
	P0 = 0xf0;

	for(i=0;i<9;i++)
	{
	wait(5000);
	  	P0 = P0+1;
	}
	}
void led()
{ 
p1=0xff;
for(t=0;t<256;t++)
		{
		wait(5000);
			P1=P1-1;
			
}

}
 

led on counter that program is different.this program is different.
this program I have to run 7 segment and led's has to run simultaneously.
 
Last edited:

The Phantom has a thousand eyes and a thousand ears. ---Old Jungle Sayings

Mr. Suga,
The above line is a complement to Mr. Alexan_e.
And I have nothing to say new. Follow his direction. You will get all answers.
 

previous program to stop(or)pause the counter program in between.in this program I have to run 7 segment and led simultaneously
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top