Shop OBEX P1 Docs P2 Docs Learn Events
Running multiple programs — Parallax Forums

Running multiple programs

Im having trouble figuring out how to run multiple programs on the BS2 2.5. i need to loops that are independent of each other so they don't slow eachother down when actually running the program. I tried to keep it in the same DO LOOP just to find out that it really slows down the whole process which the opposite of what I want to happen. the program I have right now is such:

DIR14 = 1
DIR8 = 1
DO
OUT14 = IN3
IF (IN9 = 1) THEN

FREQOUT 8, 10, 2500

ELSE

FREQOUT 8, 10, 1000

ENDIF

LOOP

Any help will be greatly appreciated

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    The BASIC Stamp can only execute one instruction at a time. Some instructions, such as the FREQOUT take a finite amount of time to complete, during which time nothing else can happen. If you need multiple concurrent tasks then the Propeller would be the way to go. Otherwise you have to work within the limits of traditional single-tasking microcontrollers.
Sign In or Register to comment.