The tone function is the simplest and most code efficient way to generate square waves of defined frequency and duration. The current implementation limits those frequencies to between 20 and 20 kHz. It looks like this could easily be extended by deleting a single if clause. Higher frequencies would be useful for ultrasonic applications like sonar, (underwater robots?), dog and cat whistles (train your animals to different tone combinations only they can hear?), IR carrier frequencies (my current need), etc.
How would this do in connection with your request?
I assume that would work fine for my needs, although I don’t understand the implementation of either method well enough to know whether one would be better than the other. Does Tone have the same limitation, that other pins on the same timer would be on the same frequency? I just don’t see any reason to limit Tone to human hearing range, when a simple change (as far as I can tell) would increase its usefulness. Do you know when Julien’s function will be rolled out?