What is the frequency range of tone()? [SOLVED]

I’m interested in using a TSOP38238 or similar for a beam-break sensor, and want to know if the tone function is capable of producing a 38 kHz signal to drive an IR LED transmitter. I don’t see anything on the forum or in the docs that indicate what the frequency range of tone() is.

I just got an oscilloscope, and it looks like 20 kHz is the top frequency; I get no signal with 20001 Hz. I assume this is a coding decision rather than a limit of the hardware. Is that correct? In what file would I find the code for Tone()? What if I want to play tunes only my cat can hear? :wink: (well, I could do that now, since I can’t hear above 10k, but cats can reportedly hear to around 77 kHz, so she’d be missing all those glorious high notes with the current implementation)

After edit: I did find the code in firmware-develop/src/stm32f2xx/tone_hal.c file, and it contains an if clause that constrains the frequencies to between 20 and 20 kHz.