I'm not sure how/if they'd interfere with tone generation, but interrupts are probably what you want to use for polling external components. I'm not sure if the Arduino supports these (I don't have an Arduino yet), but attachInterrupt
, and interruptMode
are all documented in the Wiring language reference
Also, I've wondered if it would be possible to generate tones using the touch tone generators in telephones. Each tone on touch tone phones is comprised of two different notes. I believe the column on a phone's keypad generates one of the notes, while the row generates the other. It might be possible to use high-/low-pass filters on each note of each tone to generate at least 7 different frequencies. You may not even need high-/low-pass filters. There's probably better ways to do this, but it would be an interesting hack.