His problem was likely that a value he was passing as the frequency was too big for the argument; his number he was passing was 38000, which didn't work, but 30000 did. I surmised (and he figured the same) that it was because the variable was too small (needing a signed integer, likely).
Looking at the reference, though, doesn't tell you anything about the functions arguments; ie, what their type is?
Yes, but I think the OP is suggesting that the docs that are published on the reference page should have the data types specified for all function arguments.
Udo Klein - I know to do this, yes; but short of downloading the library, unzipping it, etc - to get to that .h file on a computer on which I don't have the Arduino IDE installed doesn't make much sense in order to find out what type a particular argument is.
In the case I mentioned, I was at work, on a computer which didn't have the IDE or the tone library installed, so I went to the doc page, and...no argument types.
Yes, there are other ways, but they may not be available for all libraries, or they would involve more steps than it is worth to answer a simple question; the type definitions should be in the docs...
The header file declarationvoid play(unsigned int frequency, unsigned long duration = 0); would not lead me to the believe that frequency values must be below 32768, because the value of frequency is an unsigned int. I would assume that values upto 65,535 would be okay.
Hence, I think:
the documentation should say that only values upto 'x' (whatever that is) work if we are to understand it
adding the type doesn't tell us enough, and
I don't believe there is an obstacle to implement tone() slightly differently so that it supports frequencies upto 65,535 KHz which might be handy for folks using some types of ultrasonic emitters.