Shop OBEX P1 Docs P2 Docs Learn Events
freqout while using pulsout? — Parallax Forums

freqout while using pulsout?

mrjohnstonmrjohnston Posts: 1
edited 2011-01-17 15:55 in BASIC Stamp
Is there a way to have PULSOUT running while using FREQOUT. My class wants to get the robots to make a "backing up" beep while the BOEbot backs up.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-01-10 09:04
    No. The Stamps do only one thing at a time. You would need some kind of external hardware to be able to overlap two operations, either a beeper that gets turned on and off by the BoeBot or something like Parallax's ServoPAL which does the PULSOUT for you.
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2011-01-10 09:11
    There is a 20ms piece of time in between each PULSOUT for a servo. If you are now using a PAUSE 20 for that, you can replace it with a FREQOUT pin, 200, frequency1, frequency 2. Some can be PAUSE and others FREQOUT to get an intermittent effect.
  • Qwaszx72Qwaszx72 Posts: 30
    edited 2011-01-16 05:50
    Tracy is right, the easiest way to do it is to use the 20 ms time between pulses to make the beeping. But if you are using that time to check if the robot has encountered an obstacle, I recommend introducing the 555 chip to the class. Show them how it is helpful to use external IC's in your robot/circuit.
  • ercoerco Posts: 20,256
    edited 2011-01-17 15:55
    Great advice given here. Learning how to weave two tasks together for the single-thread stamp to accomplish is an acquired skill and a time-honored rite of passage for a programmer. Savor the opportunity!
Sign In or Register to comment.