MicroTone: A high-performance library with super tiny flash usage to create a pulse train without any CPU usage
The library can be installed manually (by unzipping and copying the files to the desired directory) or using the Arduino Library installer, there is nothing to care about.
this library was designed for attiny13A/L and Atmega8/A MCU you can build using Arduino IDE or avr-g++.
This function initializes the library
MicroTone.begin();
you can also use the begin function to set the prescaler (default = 3)
MicroTone.begin();//1-5
This function creates a pulse train on the OCR0A pin note that the parameter (like any write() function) MUST be an 8-bit value (0-255) lower value gives highier frequency
MicroTone.write(value);
This function stops the pulse train (like noTone() function)
MicroTone.stop();
This function changes the prescaler anytime you want! the given value must be from 1 to 5 for Attiny13 and 1 to 7 for Atmega8
MicroTone.setPrescaler();