Task example

Can someone please modify the program below so that each task will turn on an led. Thanks.


' {$STAMP BS2}
' {$PBASIC 2.5}
'task example 3


Main:
DO
GOSUB Critical_Task
ON task GOSUB Task0, Task1, Task2
task = task + 1 // NumTasks
LOOP
Critical_Task:
' task code
RETURN
Task0:
' task 0 code
RETURN
Task1:
' task 1 code
RETURN
Task2:
' task 1 code
IF (Emergency) THEN
GOSUB Special_Task
ENDIF

Comments

Sign In or Register to comment.