I tend to find the Piezo Transducers need a little experimenting to hit it just right... and in typical Melanie fashion I don't use the in-built PBP Commands and tend to roll my own...
Here's what works for me...
Code:
BeepToneHi var Byte ' Variable for Beep High-Period
BeepToneLo var Byte ' Variable for Beep Low-Period
BeepLength var Word ' Number of Repitition Cycles to execute
'
' Subroutine Produces Standard Beep for 2 Seconds
' -----------------------------------------------
BeepTwoSeconds:
BeepLength=8800 ' For Two Seconds
Goto BeepRAW
'
' Subroutine Produces Standard Beep for 100mS
' -------------------------------------------
BeepShort:
BeepLength=435 ' For 100mS
Goto BeepRAW
'
' Subroutine Produces Standard Beep for 250mS
' -------------------------------------------
Beep:
BeepLength=1100 ' For 250mS
BeepRaw:
BeepToneHi=111
BeepToneLo=BeepToneHi-49
For CounterC=0 to BeepLength
High Beeper
PauseUS BeepToneHi
Low Beeper
PauseUS BeepToneLo
Next CounterC
Return
Let me tell you how sharply the roll-off is for a Piezo... for me BeepTone=111 is just right... 113 or higher gives about 12dB less Sound Output, 109 or lower similarly.
I literally sat there with a Scope and a For-Next Loop giving me a two-second burst of every value from 50 to 200 to finally decide what value was loudest!
Bookmarks