White noise using a BS2
Andy Fox
Posts: 46
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.
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
Perhaps you are looking for the FREQOUT command for the BS-2 Stamps?
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
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
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.
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