The ability to synchronize tones with an external signal is extremely critical
in some applications. I've attached a patch to the Tone Library that permits
this functionality by calling a new "sync" routine from an interrupt. A simple
usage example follows:
---
Tone tone1;
void setup(void)
{
tone1.begin(OUTPUT_PIN);
tone1.play(FREQUENCY_OUT);
attachInterrupt(0, sync_risingedge, RISING);
}
void sync_risingedge(void)
{
tone1.sync();
}
void loop(void)
{
}
---
Original issue reported on code.google.com by compho...@gmail.com on 22 Apr 2011 at 7:47
Original issue reported on code.google.com by
compho...@gmail.com
on 22 Apr 2011 at 7:47Attachments: