
Originally Posted by
Dave
CuriousOne, The Parallax Propeller is truly a multicore processor. You would need multiple Pic's to do the same.
I don't see the difference in your code next to what I am suggesting? The way your's is written it will not produce the output you require.And what do you mean terminated? How about this for an interrupt example:
a = 1
MAIN:
if Interrupt = 1 then
Interrupt = 0
if PROG = 0 then
gosub program 1
else
gosub program 2
endif
endif
a = a + 1
if a > 10 then a = 0
goto main
Program1:
PRINT "A=";A
return
Program2:
PRINT "B=";B
return
This will produce the output you require.
Or without interrupts, Your way..
A=1
B=1
DO:
PRINT "A=";A
PRINT "B=";B
A=A+1
B=B+1
IF A > 10 THEN A = 1
IF B > 10 THEN B = 1
LOOP
This will produce the same output you require.
Bookmarks