Shop OBEX P1 Docs P2 Docs Learn Events
Simple gameshow buzzer — Parallax Forums

Simple gameshow buzzer

NickydogNickydog Posts: 4
edited 2009-04-21 01:01 in BASIC Stamp
We are working on a fairly simple project that has two game show buttons(pin 0 & 1)·which·when pressed, light up an LED(pin 2 & 3). We are trying to incorporate a buzzer to sound when one of the buttons·is pressed. We have the buzzer wired to pin 7 and ground. This is all wired on a Stamp microprocessor BS1-IC. We've got the lights working, but we can't seem to get the buzzer to work. Any ideas? Here is the program:

Start: Let b1=0
········ Let b2=0
········ Input 0
········ Input 1
········ Output 2
········ Low 2
········ Output 3
········ Low 3
········ Output 7
········ Low 7

Gameshow: Button 0,0,255,20,b1,0,Loop2

Win1: High 2
········ High 7
········ Goto Win1

Loop2: Button 0,0,255,20,b1,0,Nopress

Win2: High 3
········· High 7
········· Goto Win2

Nopress: Goto Gameshow
········



·

Comments

  • Mike2545Mike2545 Posts: 433
    edited 2009-04-20 23:29
    You could use a speaker and use the freqout command. You should also use a 10uf cap in series with pin 7 and the speaker.

    Or, if its a true buzzer try driving it with a transistor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.

    Post Edited (Mike2545) : 4/20/2009 11:34:37 PM GMT
  • SRLMSRLM Posts: 5,045
    edited 2009-04-20 23:35
    @Mike
    You can't use the FREQOUT command. It's only for the BS2 series.

    @Nicky
    You may one to take a look at Humanoido's Stamp One News here. It probably has what you're looking for.

    It is a buzzer and not a speaker, right? You can hook it up to a DC source and it will make sound? Just checking...
    How much current does it draw? The BS1 probably can't handle the amount of current required. You'll need to use a transistor in that case.

    Post Edited (SRLM) : 4/20/2009 11:40:34 PM GMT
  • Mike2545Mike2545 Posts: 433
    edited 2009-04-20 23:37
    Oups, then use the SOUND command

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • NickydogNickydog Posts: 4
    edited 2009-04-21 00:28
    @SRLM: It's definitely a buzzer. When we apply the battery terminals of a 9V battery directly to the wires of the buzzer it sounds. The buzzer is labeled 3-16VDC.

    Can the SOUND command work with a buzzer? Or do you have to have a speaker? This is a school project due tomorrow so we are pretty much out of time...but this is driving us nuts trying to figure out why it won't work.

    Thanks to you both!
  • Mike2545Mike2545 Posts: 433
    edited 2009-04-21 00:45
    The sound command will not work with a buzzer. You will need a transistor to drive the buzzer from the stamp pin.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • NickydogNickydog Posts: 4
    edited 2009-04-21 00:52
    Is a transistor needed only if the Sound command is used or is it needed regardless (i.e., using High command)? Thanks.
  • Mike2545Mike2545 Posts: 433
    edited 2009-04-21 00:55
    Like this for a beeper with the pin going HIGH

    No transistor is needed for a speaker with the Sound command.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
    2338 x 1700 - 76K
  • SRLMSRLM Posts: 5,045
    edited 2009-04-21 00:57
    The sound command will probably give odd results. You'll not need to use it, instead make the pin high (on) or low (off). And never mind on the transistor. I have one that I just measured(radio shack version) and it only draws 2 ma. Try adding some pause statements. That should slow down your program and give you time to hear things.
  • NickydogNickydog Posts: 4
    edited 2009-04-21 01:01
    Okay, thanks. I'll try the pause statements.
Sign In or Register to comment.