Pages: [1]   Go Down
Author Topic: Tone (rogue version) timer question  (Read 261 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
#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()
{
}

Logged

Pages: [1]   Go Up
Jump to: