Arduino is ignoring the delay command, I think

I put a little speaker from my Mega 2560's Pin47 (digital) and GND. When I give it the command:


.... I can hear the tone nice and clear, for about a second, which is what I expect. So far so good.

But when I let it execute the following series of commands, I get three notes in a row with no spaces or rests between them:

tone(47,523,200); // Play a C
tone(47,587,200); // Play a D
tone(47,659,200); // Play an E

I would expect a brief silence (1/5 of a second long) between each note, but there is no space at all.

Anyone know why? I'm probably doing something wrong, but I'm damned if I know what.

delay works. The Tone library is interrupt driven specifically to avoid pauses between successive notes.

tone() is non blocking so the 200ms duration you ask to play is the same 200ms you wait for so the notes are one after another, no pause

What kind of speaker is this? A small piezo is usually (not always) fine but Be careful connecting speakers directly to the pins - it's usually a bad idea and a current limiting resistor (To limit this initial inrush current) can and will help protect your arduino