Shop OBEX P1 Docs P2 Docs Learn Events
Multitasking — Parallax Forums

Multitasking

robotkingrobotking Posts: 1
edited 2013-12-04 21:38 in BASIC Stamp
Ok I know that the BASIC Stamp 2 is not a multiprocessor. I want to know if there is a way to play a sound in a loop, make the boe bot go forward, and alternate between two LEDs all at the same time. I have tried many different attempts and all that happens is the pause in my sound affects the pause of the servos and i cant find a way around it. Anyone know how to solve my problem?

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-12-04 16:46
    Moving while alternating LEDs is pretty easy and can be done without additional hardware. However, playing the sound may require a co-processor or a piece of hardware that can generate the sound on command. Using FREQOUT would definitely interrupt the refresh of the servos. Often times a BASIC Stamp can do more than you think with some clever code construction. But there are limits when a command completely ties up the MCU for a period of time that exceeds time needed elsewhere.
  • NWCCTVNWCCTV Posts: 3,629
    edited 2013-12-04 17:19
    What about using a SoundPal? An inexpensive yet effective way to play your sounds while still making the Boe Bot go forward. You could also add a ServoPal that would control your servos while using LED's, Ping or whatever.
  • ercoerco Posts: 20,257
    edited 2013-12-04 21:38
    Either a Soundpal or Servopal could help you with sound and servo management. In the video below, I have a RoboVoice speech chip on a BoeBot which runs 4 servos and alternates blinking red/green LEDs. The brief pauses in motion are when the servos halt while the Stamp sends serial data to the speech chip.
Sign In or Register to comment.