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.
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.
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.
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!
Comments