Hi Again. On a Basic Atom Pro 28, I could easily do this by setting up a timer with an interrupt that toggles the pin. But I don't know if that is available on the BS2. I rather doubt it.
So another approach would be to break up the code into a loop that loops sleeping by the minimum time each step takes and do something at the appropriate time in the loop.
I am not at all proud of this quick and real dirty approach. Note: I did not try this at all and my timings may be slightly off, but maybe something like:
Code:
cnt VAR Word
DO
LOW 14
FOR cnt = 0 TO (5 + 1 +650+3+650)
PAUSE 100
IF cnt = 5 THEN
HIGH 14
ELSEIF cnt = 6 THEN
LOW 15
ELSEIF cnt = (6+650) THEN
HIGH 15
ELSEIF cnt = (6+650+3)THEN
LOW 15
ENDIF
IF cnt // 5 = 0 THEN
TOGGLE 13 ' this assumes that pin 13 is new pin for LED...
ENDIF
NEXT
LOOP
I would be much happier with the code if I built a table with a time value and an indicator of what to do, but...
I hope this helps
Kurt