I want to use this code for my christmas light:


I've modified it for 5 leds and it works fine. However, I want it to not spin forever, but change some values, like speed and trails after several runs.

All the magic is done via this code as I can guess:

Main:    if LoopCount = TracerSpeed then             ; __[ Cylon/Kitt Scanner ]__      LoopCount = 0      BAM_DUTY(NextLED)=Brightness      if TraceDIR then                          ; if scanning left        NextLED = NextLED - 1        if NextLED = 0 then TraceDIR = 0      else                                      ; else scanning right        NextLED = NextLED + 1        if NextLED = BAM_COUNT-1 then TraceDIR = 1      endif    endif        FOR Idx = 0 to BAM_COUNT - 1                ; Drain all dutycycles       IF BAM_DUTY(Idx) > 0 then           BAM_DUTY(Idx)=BAM_DUTY(Idx)*DrainSpeed/(DrainSpeed+1)       ENDIF    NEXT Idx    pause Speed    LoopCount = LoopCount + 1GOTO Main
It all works fine, besides that I can't find, how many times it loops for complete cycle? - I mean, single run from left to right and back, with all fades.Any ideas?