Page 2 of 2

Re: tone() and notone() have been added to the libmaple core

Posted: Tue Nov 29, 2016 2:11 pm
by VadimEL
just tested with motherboard buzzer, works great =)

Re: tone() and notone() have been added to the libmaple core

Posted: Tue Nov 29, 2016 3:44 pm
by ahull
VadimEL wrote:just tested with motherboard buzzer, works great =)
Generally motherboard buzzers contain a driver transistor and a small inductor.. something similar to this..

Image

This means they are a lot louder than simply driving the piezo element straight form a GPIO pin.
BTW the value of the inductor is not too critical, 10mH to 50mH will probably work, but if you want the best bang for your buck, then the value depends on the frequencies you are aiming for.

The physical size of your piezo element also determines which frequencies will be loudest. Typically a smaller piezo will have a higher resonant frequency. Piezos are typically loudest around their resonant frequency. This is why those cheap greetings cards are so high pitched, and quiet.

If you want to annoy the neighbours you will need a moving coil loudspeaker or two and an amplifier. Fortunately these are also really cheap these days..

http://www.ebay.co.uk/itm/152139205806? ... EBIDX%3AIT
5 off 2x3 Watt Class D for US $1.33 shipped.
Image
Datsheet => http://www.diodes.com/datasheets/PAM8403.pdf
Image

They should be enough for our purposes. ;) Add an 8 Ohm speaker or two to that little PCB and a dual 10k logarithmic pot to control the volume to the inputs and its time prove to the world that you can have too much Mario brothers. :lol:
EDIT: If you can't be bothered adding your own volume control, there is a version of the board with the dual pot built in.
http://www.ebay.co.uk/itm/PAM8403-Audio ... SwiONYOHFx

Re: tone() and notone() have been added to the libmaple core

Posted: Tue Nov 29, 2016 4:33 pm
by VadimEL
http://radikal.ru/video/jfPWXLYJyPZ
yes it's loud enough.
==========================
How to off sound?

noTone(melodyPin); - did not work :(

Re: tone() and notone() have been added to the libmaple core

Posted: Sat Dec 10, 2016 8:08 pm
by VadimEL
it's killing sound :lol:

for(int toneHZ=0;toneHZ<18000;toneHZ++)
{
tone(melodyPin, toneHZ, 10); // play Hz tone for 10 ms

delay(10);//pause 10
}

Re: tone() and notone() have been added to the libmaple core

Posted: Sun Dec 11, 2016 6:42 pm
by VadimEL
it may be used to generate 24.3 Khz for Dog Repeller?

tone(melodyPin, 24300, 10);

===============================

SONIC NAUSEA - hmm what frequency
https://youtu.be/vwGcGy-JZgs?t=129

Re: tone() and notone() have been added to the libmaple core

Posted: Sun Dec 11, 2016 7:18 pm
by ahull
VadimEL wrote:it may be used to generate 24.3 Khz for Dog Repeller?

tone(melodyPin, 24300, 10);

===============================

SONIC NAUSEA - hmm what frequency
https://youtu.be/vwGcGy-JZgs?t=129
Try it and see, but you will obviously need a speaker/resonator that can handle 24.3 Khz

Re: tone() and notone() have been added to the libmaple core

Posted: Sun Dec 11, 2016 7:34 pm
by zmemw16
a target dog ( or cat ) as well ? :evil:

Re: tone() and notone() have been added to the libmaple core

Posted: Mon Dec 12, 2016 7:13 am
by RogerClark
I've just done some bug fixing

you should not need to include tone.h or tone.cpp for it to compile

also noTone now works

Also, I have hopefully fixed some issues raised by Rick, which show up when the compiler flags are set to "WALL"