Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/09/03 09:02
Read: times


 
#56406 - break sequence
Im using 4 inputs of a at89c52 (p3.2 to p3.5) to drive 4 different led sequences coming from p1, the problem is im using for loops to do the sequences but if i select a sequence when another one is still running it wont work. How can i break the sequence and continue with the one i selected. Heres part of my code using just 2 sequences:

while(1)
{
while(P3_2==1);
delay(50); //delay to debounce
for(i=0;i<12;i++)
{
P1=~tled1[i];
delay(75); //flashing sequence
if(P3_3==1) //exit to other sequence
break;
}

while(P3_3==1);
for(i=0;i<12;i++)
{
P1=~tled2[i];
delay(75); //flashing sequence
if(P3_2==1) //exit to other sequence
break;
}

}

List of 9 messages in thread
TopicAuthorDate
break sequence            01/01/70 00:00      
   RE: break sequence            01/01/70 00:00      
   RE: break sequence            01/01/70 00:00      
   RE: break sequence            01/01/70 00:00      
   RE: break sequence            01/01/70 00:00      
   RE: break sequence            01/01/70 00:00      
   RE: Better Approach            01/01/70 00:00      
      RE: Better Approach            01/01/70 00:00      
         RE: Better Approach            01/01/70 00:00      

Back to Subject List