I need to modify the duty cycle of the tone() function. Is there any straight forward way of doing this? I was thinking of setting OCR2A, if that's used by the function, but I don't exactly know how tone() works.
(deleted)
I think I managed to do it, using the pwm function of the TimerOne library.
The reason I need to change the duty cycle is because the audio signal will ultimately drive a 6ft tall tesla coil, and this should be run at around 10-20% duty cycle to prevent its primary winding from being overheated.
In which case why would you not generate a signal similar to what is used with IR remotes?
Because tone() makes it easier to play music.
I think the oneTesla code is open-source. They can play two simultaneous tones on one Tesla coil.
MorganS:
Because tone() makes it easier to play music.
Right. tone to play music.
With that signal modulated by a much higher frequency (a carrier).