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.

help me with this code.....

Status
Not open for further replies.

subinalex

Junior Member level 1
Joined
May 27, 2010
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
kattappana
Activity points
1,427
void counter()
{
unsigned long int i,j;
for(j=0;j<60;j++)
{
for(i=0;i<800;i++)
{
if(!rec1)
{
while(!rec1);
while(rec2);
while(!rec2);
if(count<0xff)
count++;


}
if (!rec2)
{
while(!rec2);
while(rec1);
while(!rec1);
if(count>0)
count--;

}


}
}

}

THIS is the visitor cntr code i use..the output of tsop1=rec1 and tsop2=rec2 is connected to p3.6 and p3.7 of 89c51 respectively..i use polling technique here...

but when i run this code.....the program get stuck ...i know it may b because of either of tsop not being cut ...it may loop in the while instruction.....

can any body gimme a much simpler code in c......
 

Hi,
But this is a very simple code, so why do you want simpler one? :)
You have to check where is the problem. Check if rec1 and rec2 react on changes in P3.6 and P3.7, check where you get stuck, etc.
Don't give up so quickly. When you will make it running I'm sure you'll be proud of yourself and what is the most important more experienced.
 

If you will provide flow chart than it will be easy to write code for you.

Just make sure you understand logic properly than it will be easy to implement.

Regards
Chanchal
 

thaank u ndru_w the problem was that the tsop-ir (2 set of them) were placed very closely......

so a tsop wasnt cut properly by an obstacle....

NOW its workinge.....FINE......

:D:D:D:D:!:
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top