This is my first post here and I have a question about a function I have made. LATA is 8-bits long and all bits are set ok as in the code below, but what I want the code to do is leave the previous bit set as well and not turn it off so that at the end of the loop all bits are set.
Any help on this I will appreciate it.
void LED_test (void)
LATA = 0b00000001;
for (i = 0; i < 7; i++)
Delay_Us( Delay_750mS_Cnt );
LATA = LATA << 1;
Have another copy of LATA, perhaps SUNA. Before you shift LATA, copy to SUNA, and then OR SUNA into LATA.
(Get it - sooner, later.. har har)
Perhaps then invert LATA and add one to it - eliminates looping.
Originally Posted by drkidd22
Originally Posted by Dino