You are on page 1of 1

int main (void)

{
unsigned int j; /* LED var */
IODIR1 = 0xFF0000; /* P1.16..23 defined as Outputs */
init_timer();
while (1)
{ /* Loop forever */
for (j = 0x010000; j < 0x800000; j <<= 1) { /* Blink LED 0,1,2,3,4,5,6 */
IOSET1 = j; /* Turn on L
ED */
wait (); /* call
wait function */
IOCLR1 = j; /* Turn off L
ED */
}
for (j = 0x800000; j > 0x010000; j >>=1 ) { /* Blink LED 7,6,5,4,3,2,1 */
IOSET1 = j; /* Turn on
LED */
wait (); /* call
wait function */
IOCLR1 = j; /* Turn off
LED */
}
}
}

You might also like