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......
{
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......