Pls improve http://arduino.cc/en/Reference/Tone

I hope someone with the expertise to answer the following and the authority to edit...

http://arduino.cc/en/Reference/Tone

... will improve one thing, and address another there...

a) The page currently says...

"If you want to play different pitches on multiple pins, you need to call noTone() on one pin before calling tone() on the next pin"...

Does this mean you can, say, produce a middle C on pin 4 AT THE SAME TIME as, say, an F on pin 5?

If not, why introduce all the stuff about multiple pins. If so.. what does calling noTone() do? To someone who isn't used to the Tone library, it would seem than "noTone()" would stop the generation of the square wave.

b) I assume that the library is non-blocking... but it would be nice to have an explicit reassurance on the reference page. By "non-blocking", I mean, for a simple example, that I could, with a speaker on pin 3, a momentary switch on pin 4, and an LED on pin 5 set up a program tp....

Start a tone sounding when the program starts... it should run continually...

.... and in loop(), pseudo code here...

if pin 4 low, switch LED on, else switch it off.

Thanks, Tone experts!

tkbyd:
I hope someone with the expertise to answer the following

I'll give it a shot.

and the authority to edit...

Can't help with that one.

"If you want to play different pitches on multiple pins, you need to call noTone() on one pin before calling tone() on the next pin"...
Does this mean you can, say, produce a middle C on pin 4 AT THE SAME TIME as, say, an F on pin 5?

The description does not match the functionality. The tone function is not capable of generating multiple tones at the same time. It does support arbitrary pins. You can play one tone at one time on a single pin.

If not, why introduce all the stuff about multiple pins.

I've wondered that as well. I have a difficult time imagining why someone would want to use arbitrary pins but only one at a time.

I believe that, at one time, the plan was to support multiple simultaneous outputs. The Tone Library does have that functionality.

If so.. what does calling noTone() do?

Shuts off tone generation and resets the internal state so the user can, if desired, switch to another pin.

b) I assume that the library is non-blocking...

It is.

but it would be nice to have an explicit reassurance on the reference page

I agree.

I suppose the paragraph about how you could send different tones to different pins was meant to help people who were thinking they could get over the "one tone at a time" restriction by using multiple pins.

If so, perhaps the paragraph could be re-written to include something along the lines of....

"It is no good thinking that if you used multiple pins you could..."

Aaah.. cleared my confusion.. thanks :slight_smile:

Well, I suppose if one person was helped that's something.

THE POINT OF THE POST is in the subject line....

And I posted it where I did because that's where the following, on the reference page, took me...

Corrections, suggestions, and new documentation should be posted to the Forum.

... but then the post was moved away from the "improve the documentation" area to a different place.

Or maybe the page's "Corrections" link needs work too?

Anyway... the page remains unclear. I hope someone with the authority to act on the information supplied will do so.