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

Information on the latest releases
VadimEL
Posts: 66
Joined: Sat Aug 13, 2016 1:28 pm

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

Post by VadimEL » Tue Nov 29, 2016 2:11 pm

just tested with motherboard buzzer, works great =)

User avatar
ahull
Posts: 1528
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

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

Post by ahull » Tue Nov 29, 2016 3:44 pm

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
- Andy Hull -

VadimEL
Posts: 66
Joined: Sat Aug 13, 2016 1:28 pm

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

Post by VadimEL » Tue Nov 29, 2016 4:33 pm

http://radikal.ru/video/jfPWXLYJyPZ
yes it's loud enough.
==========================
How to off sound?

noTone(melodyPin); - did not work :(

VadimEL
Posts: 66
Joined: Sat Aug 13, 2016 1:28 pm

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

Post by VadimEL » Sat Dec 10, 2016 8:08 pm

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
}

VadimEL
Posts: 66
Joined: Sat Aug 13, 2016 1:28 pm

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

Post by VadimEL » Sun Dec 11, 2016 6:42 pm

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

User avatar
ahull
Posts: 1528
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

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

Post by ahull » Sun Dec 11, 2016 7:18 pm

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
- Andy Hull -

zmemw16
Posts: 1263
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

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

Post by zmemw16 » Sun Dec 11, 2016 7:34 pm

a target dog ( or cat ) as well ? :evil:

User avatar
RogerClark
Posts: 6130
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

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

Post by RogerClark » Mon Dec 12, 2016 7:13 am

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"

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests