PDA

View Full Version : Cricket Sound Effect



koossa
- 14th January 2008, 13:10
Good day Picers

I am trying to make a cricket sound effect using the PBP Sound command.

When using a larger Capacitor (100uF) I get higher notes, will this damage my speaker if I use a 100uF instead of a 10uF?

Thank you
koossa
<bgsound src="http://www.darreltaylor.com/files/cricket.wav" LOOP=5>

b1arrk5
- 15th January 2008, 00:32
I think your speaker is safe, the capacitor value shouldn't be too critical in this case.
Good Luck!

Jerry.

koossa
- 15th January 2008, 09:10
Here is the code using a 100uF capacitor.




Include "Modedefs.bas"

DEFINE OSC 4 ' Set the Xtal frequency
CCP1CON = 0
SPEAKERPIN VAR PORTD.2
i var byte

Main:
for i = 0 to 8
SOUND SPEAKERPIN, [125, 1]
pause 7
next i

pause 150

for i = 0 to 8
SOUND SPEAKERPIN, [125, 1]
pause 7
next i

END