Shop OBEX P1 Docs P2 Docs Learn Events
Multiple programs at once — Parallax Forums

Multiple programs at once

musictechmusictech Posts: 54
edited 2005-04-04 19:35 in BASIC Stamp
I have been assigned a project at my university for a robotics fair. Basically I need to make a stamp send and recieve communications, make noise, and move/fire all at the same time. Right now I am just dealing with the sound and movement issues. I am using a standard piezo speaker and a standard servo. I am using pulsout to produce movement as well as the sound I want. The sound made by the speaker requires four lines of repeating code to produce and the servo requires one line of repeating code to work. The problem is, when coexisting the speaker sound and the servo movement is choppy. Anyway I can do those 2 things seperately without using 2 stamps?

Thanks

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-04-04 19:35
    No. The BASIC Stamp is a single-tasking device and you must wait for one command to finish before moving to another. That said, with a bit of analysis you can use the time required to run code in place of PAUSE instructions that might be used -- this is particularly useful when it comes to servo updating; instead of using PAUSE 20 (as is very commond), call other chunks of code that would consume about that much time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
Sign In or Register to comment.