Piezo Speaker?
Dan Taylor
Posts: 207
I cannot figure out how to make a sound with the propeller chip and a pieze speaker! Can someone show me a simple code for a speaker connected to pin 3?
Thanks in advance!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dan Taylor
Thanks in advance!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dan Taylor
Comments
I also tried the program that has two speakers. One on pin 3 and one on pin 27. But it still doesn't work.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dan Taylor
Vince
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Briel Computers
http://www.brielcomputers.com
I think I got confused with the code when changing the pin. Could you help?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dan Taylor
Hey Vince.. nice to see your here too.. A2 Forever!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New ICON coming, gotta wait for the INK to heal, now we have colour!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
www.tdswieter.com
Hey Dan, yeah, if you can just paste the code, any info would help. It's always the little things, AWLAYS.
Vince
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Briel Computers
http://www.brielcomputers.com
''SquareWaveTest.spin
''Send 2093 Hz square wave to P27 for 1 s with counter module.
CON
_clkmode = xtal1 + pll16x ' Set up clkfreq = 80 MHz.
_xinfreq = 5_000_000
PUB TestFrequency
'Configure ctra module
ctra[noparse][[/noparse]30..26] := %00100 ' Set ctra for "NCO single-ended"
ctra[noparse][[/noparse]5..0] := 27 ' Set APIN to P27
frqa := 112_367 ' Set frqa for 2093 Hz (C7 note) using:
' FRQA/B = frequency
The lower the waitcnt number the higher the pitch.
[code]
CON
_clkmode = xtal1 + pll16x ' Set up clkfreq = 80 MHz.
_xinfreq = 5_000_000
PUB TestFrequency
'Configure ctra module
ctra[noparse][[/noparse]30..26] := %00100 ' Set ctra for "NCO single-ended"
ctra[noparse][[/noparse]5..0] := 3 ' Set APIN to P3
frqa := 112_367 ' Set frqa for 2093 Hz (C7 note) using: ' FRQA/B = frequency
However do you know how they got the programs to sing? Like the "seven" song?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dan Taylor