PDA

View Full Version : Amazing Grace played through the Basic Stamp



Spiral_72
03-05-2010, 11:09 PM
I thought this was REALLY cool. http://forums.parallax.com/images/smilies/cool.gif

It's hard coded for the BS2px, so not fancy DATA tables or anything but it plays Amazing Grace with the harmonics :)

Wire a small speaker according to the schematic found in the BASIC_STAMP_Manual_v2_2.PDF on page 200

Enjoy!






' {$STAMP BS2px}
' {$PBASIC 2.5}
' {$PORT COM1}

A CON 440
B CON 494
D CON 294
E CON 330
G CON 392
D5 CON 587

B03 CON 247
C4 CON 262
FS4 CON 370

TX CON 32
T8 CON 62
T2 CON 250
T1 CON 125

OUTPUT 7 'Set pin 7 to output

FREQOUT 7,TX*T8,D,B03
FREQOUT 7,TX*T8,E,C4
FREQOUT 7,TX*T2,G,B03
FREQOUT 7,TX*T8,B,D
FREQOUT 7,TX*T8,G,B03
FREQOUT 7,TX*T2,B,D
FREQOUT 7,TX*T1,A,C4
FREQOUT 7,TX*T2,G,B03
FREQOUT 7,TX*T1,E,C4
FREQOUT 7,TX*T2,D,B03
FREQOUT 7,TX*T8,D,B03
FREQOUT 7,TX*T8,E,C4
FREQOUT 7,TX*T2,G,B03
FREQOUT 7,TX*T8,B,D
FREQOUT 7,TX*T8,G,B03
FREQOUT 7,TX*T2,B,D
FREQOUT 7,TX*T8,A,D
FREQOUT 7,TX*T8,B,D
FREQOUT 7,TX*375,D5,FS4
FREQOUT 7,TX*T8,A,D
FREQOUT 7,TX*T8,B,D
FREQOUT 7,TX*T2,D5,D
FREQOUT 7,TX*T8,D5,D
FREQOUT 7,TX*T8,B,D
FREQOUT 7,TX*T2,G,B03
FREQOUT 7,TX*T8,E,C4
FREQOUT 7,TX*T8,D,B03
FREQOUT 7,TX*T2,G,E
FREQOUT 7,TX*T1,E,C4
FREQOUT 7,TX*T2,D,B03
FREQOUT 7,TX*T8,D,B03
FREQOUT 7,TX*T8,E,C4
FREQOUT 7,TX*T2,G,B03
FREQOUT 7,TX*T8,B,D
FREQOUT 7,TX*T8,G,D
FREQOUT 7,TX*T2,B,D
FREQOUT 7,TX*T1,A,C4
FREQOUT 7,TX*T2,G,B03

END


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"puff"...... crap, there went another one.

Post Edited (Spiral_72) : 3/5/2010 4:53:06 PM GMT

Chris Savage
03-06-2010, 02:45 AM
This thread is being moved from the Completed Projects Forum to the BASIC Stamp forum where it is on-topic.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage

Parallax Engineering