Couldn't edit my last post for some reason - so here's another idea to try:
Where you have some code like this:
SW10:
PulsOut PORTA.2, 50000
Pause 500
PulsOut PORTA.2, 50000
Pause 500
PulsOut PORTA.2, 50000
Pause 500
PulsOut PORTA.2, 50000
Pause 500
PulsOut PORTA.2, 50000
Pause 500
PulsOut PORTA.2, 50000
Pause 500
PulsOut PORTA.2, 50000
Pause 500
PulsOut PORTA.2, 50000
Pause 500
PulsOut PORTA.2, 50000
Pause 500
PulsOut PORTA.2, 50000
You could try this:
CounterA VAR BYTE
FOR CounterA = 0 TO 9
PulsOut PORTA.2, 50000
Pause 500
NEXT CounterA
Or get rid of the PULSEOUT as mentioned above.
Starting the FOR...NEXT loop at 0 instead of 1 saves a bit of space too.
>>>>
Also, you could set up the loop in a sub-routine, then just load a CounterStop value:
CounterStop VAR BYTE
; Your code sets a loop amount here.
CounterStop = 5 ; Or whatever amount of loops you want
GoSUB HornLoops
Horn_Loops:
FOR CounterA = 1 TO CounterStop
PulsOut PORTA.2, 50000
Pause 500
NEXT CounterA
RETURN
Arch
Bookmarks