OK, not quite understanding completely when you say that. I've changed the code around a bit, so I guess that's why it doesn't make much sense. I've done this so far:
Code:
ZigZag DATA Word %0000, 100
DATA Word %0001, 100
DATA Word %0010, 100
DATA Word %0100, 100
DATA Word %1000, 100
DATA Word %0000, 100
DATA Word %1000, 100
DATA Word %0100, 100
DATA Word %0010, 100
DATA Word %0001, 100
DATA Word %0000, 100
DATA Word %0000, 0
Later in the code, I have this:
Code:
Main:
Idx = 0
repeat
READ Idx, WORD Pattern, timer ; get pattern from EEPROM
IF (timer > 0) THEN
@ WritePort _Pattern, MyPortPins ; write pattern to Virtual Port
PAUSE timer
Idx = Idx + 3
endif
until timer = 0
goto Main
I've added a more complex code after this so as to be able to take a small segment from above and create a variable to the FOR-NEXT loop to be able to increase repetitions without having to write additional 1s and 0s.
In essence, it is to simulate:
Code:
FOR x = 1 to reps
high 1
pause 100
low 1
pause 100
NEXT x
FOR x = 1 to reps
high 2
pause 100
low 2
pause 100
NEXT x
Where "reps" can be incremented to create multiple flashes and still not take up additional space. It won't be getting it's code from ZigZag, but rather another "baseline" of code. I have other additional patterns in mind that will be its own entity like ZigZag, but wanted to be able to call it. This is where I'm a little confused as far as listing the length of code in the first byte.
Thanks,
Tony
Bookmarks