void interrupt ISR()
{ static unsigned char step = 0;
static unsigned char toggle[64] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
PORTB ^= toggle[step]; // update channel outputs
toggle[step] = 0; // clear element for next period
step++; //
if(step == 64) // if end-of-period
{ step = 0; //
toggle[led[0]] |= 1; // insert LED 0 toggle bit
toggle[led[1]] |= 2; // insert LED 1 toggle bit
toggle[led[2]] |= 4; // insert LED 2 toggle bit
toggle[led[3]] |= 8; // insert LED 3 toggle bit
toggle[led[4]] |= 16; // insert LED 4 toggle bit
toggle[led[5]] |= 32; // insert LED 5 toggle bit
toggle[led[6]] |= 64; // insert LED 6 toggle bit
toggle[led[7]] |=128; // insert LED 7 toggle bit
toggle[0] ^= ~PORTB; // initialize first toggle element
} //
TMR0 = 210; // adjusts step size & frame rate
TMR0IF = 0; //
} //