led_pattern: allow the sequence to repeat n times or forever