ok so what i am trying to do is have an led flash on and off at one speed and then flash at at another speed for a set period of time...i am pretty sure that i need two for loops to do this but i am not sure how this works
i would like to have the first for loop just flash the led four times and then have the second for loop flash the led 8 times
the leds flashing time is determined by an interrupt and the is working correctly...i just need help getting the for loops to work
the way i am controlling the leds is not an issue i have that underwraps but i am not sure how to just have the led flash on four four times and the have it flash on again at a different speed for eight timesCode:int i=0, j=0 for(i=0; i<4; i++){ if(G_Flag){ led on; } else{ led off; } i++; }if(i=4){ for(i=4;i<8<i++) { if(G_Flag) led on; else led off i++ } } i=0 } interrupt_ISR { G_Flag = !G_Flag }
i thought that this code would work because once i is equal to four it would go into the second for loop but it doesn't work and i don't understand why



LinkBack URL
About LinkBacks




loop.
