Shop OBEX P1 Docs P2 Docs Learn Events
White noise using a BS2 — Parallax Forums

White noise using a BS2

Andy FoxAndy Fox Posts: 46
edited 2007-10-09 23:06 in BASIC Stamp
Does anyone have a schematic/circuit/hunk of code or know of a good sound generator IC that I could use with a BS2 to generate white noise of variable pitch/frequency?

It greatly confuses me that the BS1 has this ability via the SOUND command and that Parallex decided to drop that command in PBASIC 2.0 and 2.5.

Thanks.

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-10-09 08:22
    Andy -

    Perhaps you are looking for the FREQOUT command for the BS-2 Stamps?

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-10-09 12:59
    try:

    x var word
    do

    pulsout 0,x & $3ff

    low 0 'adding and subtracting low commands will change the pitch
    low 0
    low 0

    loop

    use a .o1microfarad cap to ground on pin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR
  • Andy FoxAndy Fox Posts: 46
    edited 2007-10-09 19:53
    TechnoRobbo said...
    try:

    x var word
    do

    pulsout 0,x & $3ff

    low 0 'adding and subtracting low commands will change the pitch
    low 0
    low 0

    loop

    use a .o1microfarad cap to ground on pin

    Hmmm. Crude but interesting! I think you forgot the "RANDOM x" line in the do-loop? Otherwise it just produces nothing or a steady tone.

    This works, but only gets me into the mid-range frequency noise. I'd like to produce noise from a low rumble to a hiss using a BS2.
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-10-09 23:06
    yes I for got the random x.

    Program actually looks like this

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

    x VAR Word
    OUTPUT 0

    DO
    RANDOM· x
    PULSOUT 0,x & $3ff
    LOW 0:LOW 0:LOW 0:LOW 0
    LOOP

    and it's a .1 not .01 uf cap, sorry.




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR

    Post Edited (TechnoRobbo) : 10/9/2007 11:11:42 PM GMT
Sign In or Register to comment.