I'm doing it backwards. Mainloop turns on leds, start a timer, while timer runs gosub main code, turn off leds when timer over. Start a 2nd timer for off period, gosub main code until over. Rinse and repeat.

I adjust 2 timers until no more flicker.

Robert