Tone library using 16 bit timer

Hi,
Ive seen this subject in other threads but not the explanation or how to
(sorry still learning!)

so I want to use the tone library to generate tones from 1 hz,
I saw that the 16 bit timer needs to be used,
so how to I have to change to accomplish this?

thank you
:wink:

I second this question. I have been looking to do the exact same thing.

hi, thank you to mr Brett Hagman of Rogue Robotics
for the library and the explanation,
tone library:
http://code.google.com/p/rogue-code/wiki/ToneLibraryDocumentation

I have put togher this code, to generate 1Hz, 10 Hz, and 50Hz as test,

#include <Tone.h>

Tone freq1;
Tone freq2;

void setup()
{
 freq1.begin(11);
 freq2.begin(8);
}

void loop()
{
  freq2.play(1, 6000);
  delay (2000);
  freq2.play(10, 6000);
  delay (2000);
  freq2.play(50, 6000);
  delay (2000);
}

the freq2 is the timer of 16 bits
" The timers are allocated sequentially when you declare the Tone objects. The second timer is Timer 1, which is a 16 bit timer."

Ok, very nice, thank you again Brett for the library and the explanation,
now to do my project !!! hahaha :smiley:

Thank you very much for the reply! This had been driving me nuts trying to figure out how to use Timer1.

I had also PM'd Brett, but I guess he got back to you first :smiley:

Can I assume that only Timer1 is 16bit? For my project, I actually need 2 outputs (to drive a speedometer and a tachometer, both requiring a square wave with a frequency range of 0 to ~230 hz).

Thanks again!