Shop OBEX P1 Docs P2 Docs Learn Events
BS2 siren code — Parallax Forums

BS2 siren code

bomberbomber Posts: 297
edited 2011-06-13 09:08 in BASIC Stamp
Hello, I need some BS2 code for either this warning sound or this Klaxon alarm sound to be played 5 times on a piezo buzzer (connected to pin 0) and then stop. I don't need the graphics, I just need the sound.

Comments

  • FranklinFranklin Posts: 4,747
    edited 2011-06-12 10:51
  • Mike GreenMike Green Posts: 23,101
    edited 2011-06-12 10:53
    You are going to have to do some experimenting on your own. The BS2 is pretty limited in what sorts of sounds it can make and you'll have to decide what satisfies you. The main statement for sound making is the FREQOUT which can make one or two relatively pure tones (read the manual for details. The "warning sound" sounds like some kind of modem, changing between two tones at high speed to make that sort of warbling sound. The BS2 really isn't fast enough to do that, but you could experiment with one short FREQOUT after another in a loop with different frequencies.
  • bomberbomber Posts: 297
    edited 2011-06-12 17:23
    I finally got the klaxon horn sound!! I tried to put the recorded sound file onto the fourm as an attatchment, but for some reason, the file wouldn't show up!
  • FranklinFranklin Posts: 4,747
    edited 2011-06-12 18:32
    but it didn't work:frown::frown::frown::frown::frown::frown:
    That's not very helpful. Does it do anything? Do you get any errors?
  • bomberbomber Posts: 297
    edited 2011-06-13 07:06
    What I meant to say (I was pressed for time yesterday) was something like : "I tried to put the recorded sound file onto the fourm as an attatchment, but for some reason, the file wouldn't show up!!".
  • bomberbomber Posts: 297
    edited 2011-06-13 07:08
    P.S. the code works fine:)
  • ercoerco Posts: 20,256
    edited 2011-06-13 09:08
    Good job! I bet lots of people have made interesting sounds with the BS2. It sure would be nice if there was an ONLINE LIBRARY where people could post them to share. Kinda sorta like the object exchange. Any chance, Parallax?
Sign In or Register to comment.