Shop OBEX P1 Docs P2 Docs Learn Events
play sound of my basic stamp board — Parallax Forums

play sound of my basic stamp board

polypoly Posts: 5
edited 2014-12-16 11:08 in BASIC Stamp
Hi everybody..need help here....I already have my set up working for my christmas lights...I'm using a parallax basic stamp board and 4-relay board....I want to be able to play my sequense music on my speakers outside my house...PLEASE ADVICE....

Comments

  • polypoly Posts: 5
    edited 2014-12-15 12:24
    ??????????????????
  • Mike GreenMike Green Posts: 23,101
    edited 2014-12-15 12:56
    You probably haven't gotten any advice because you've provided insufficient information. What sort of music are you proposing? What kind of speakers do you want to use? Pretty much any speakers will require amplification. Do you have an amplifier you plan to use? There is a lot of documentation in the Stamp Reference Manual on how to use the FREQOUT statement if that's what you plan to use including a schematic for the interface between a Stamp I/O pin and an amplifier line input.

    How would the sound generation and light control work together? How about attaching a source file for your program as it stands?
  • polypoly Posts: 5
    edited 2014-12-16 09:23
    I'm using
    (1) HomeWork Board with BASIC Stamp
    (5) 470 Ω Resistors
    (3) Green LEDs
    (2) Red LEDs
    (1) Piezospeaker
    (1) 5-Position Switch

    this is the code

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    HIGH 15 ' Turn on all LEDs
    HIGH 14
    HIGH 13
    HIGH 12
    HIGH 11

    FREQOUT 8, 2000, 3000 ' Play a tone

    DEBUG CLS, ' Display directional graph
    " ", CR,
    " | ", CR,
    " - - ", CR,
    " | ", CR

    ' Display which direction is pressed on the 5-Position Switch
    DO
    IF (IN0 = 0) THEN DEBUG CRSRXY, 2, 2, "<" ELSE DEBUG CRSRXY, 2, 2, " "
    IF (IN1 = 0) THEN DEBUG CRSRXY, 5, 4, "v" ELSE DEBUG CRSRXY, 5, 4, " "
    IF (IN2 = 0) THEN DEBUG CRSRXY, 8, 2, ">" ELSE DEBUG CRSRXY, 8, 2, " "
    IF (IN3 = 0) THEN DEBUG CRSRXY, 5, 2, "o" ELSE DEBUG CRSRXY, 5, 2, " "
    IF (IN4 = 0) THEN DEBUG CRSRXY, 5, 0, "^" ELSE DEBUG CRSRXY, 5, 0, " "
    PAUSE 20
    LOOP

    SEE I'M USING MY OUTPUTS TO CONTROL A 4-RELAY BOARD THAT IS CONTROLLING THE POWER OUTPUT TO FOUR 120V OUTLETS THE LIGHTS CHANGE WITH THE MUSIC BUT IT IS NOT LOUD ENOUGH I WANT TO BE ABLE TO CONECT MY COMPUTER SPEAKERS TO IT....
  • Mike GreenMike Green Posts: 23,101
    edited 2014-12-16 11:08
    Try the filter shown in the Stamp Reference Manual in the chapter on the FREQOUT statement. Keep in mind that all the HomeWork Board I/O pins already have 220 Ohm resistors in series with them. If you add 470 Ohm resistors, the total resistance is 690 Ohms. That would make your LEDs dimmer than you might expect. If you're going to use computer speakers, you might also try the 2nd schematic for use with small speakers with the two added capacitors since the computer speakers are usually designed to plug-in in place of headphones.
Sign In or Register to comment.