Go Down

Topic: Tone (rogue version) timer question (Read 298 times) previous topic - next topic

ArduinoTom

Re this toner library:

http://code.google.com/p/rogue-code/wiki/ToneLibraryDocumentation

The documentation says it can go down to 1Hz if a 16 bit timer is used.  How do I make it default to a 16 bit timer on a mega2560?

ArduinoTom

I think I've tricked it into using the 16 bit timer, but simply using a dummy tone1 and using tone2 for the actual tone manipulation. However, when I run the test code below, I see the output of tone2 goes to zero for about 200ms after it plays the 5hz tone but before it plays the 30hz tone.  What is causing that delay and how might I eliminate it?


Code: [Select]

#include <Tone.h>

Tone tone1;
Tone tone2;
void setup()


tone1.begin(12);
tone2.begin(13); 

tone1.play(32);


tone2.play(5);
delay(10000);
tone2.play(30);
delay(10000);
}

void loop()
{
}


Go Up