Hi everyone,
I'm trying to use the native tone() function to generate a 38KHz signal for IR transmission however I don't believe I'm getting the correct output.
tone(13, 38000,1000) should give me a 38KHz signal on pin13 for 1 second, however I only see the pin on for a very short time (definitely not one second). I lowered the frequency to 30000 (30KHz) and the duration is correct. I'm just wondering what the maximum frequency tone() is able to correctly produce?
I would like to use the tone() function instead of creating my own because it's non-blocking. :-?
=== update ===
i think i just answered my own question: most likely the argument for frequency is an int, which means the max value is 2^15... JUST shy of 38000.
Any suggestions for how I can get the library to support an unsigned int or long as the frequency argument?