NewTone Library - Plug-in replacement for Tone library - Better, smaller, faster

Hi have been trying to adapt to use it on Timer "4" on the mega
As i can not use it on Timer 1 as it then conflicts width my PWM signals on the MEGA 2560 ;-(
I am trying to drive a speedometer
as you see i have just tryed to change the 1 to 4 not sure i know what i am doing
Any reply greatly appriciatet :wink:

I have changed here

NewTone.h

#define TIMSK4 TIMSK //#define TIMSK1 TIMSK

NewTone.cpp

ICR4 = top; // Set the top.
if (TCNT4 > top) TCNT4 = top; // Counter over the top, put within range.
TCCR4B = _BV(WGM40) | prescaler; // Set PWM, phase and frequency corrected (ICR1) and prescaler.
TCCR4A = _BV(COM4B0);
TIMSK4 |= _BV(OCIE4A); // Activate the timer interrupt.

TIMSK4 &= ~_BV(OCIE4A); // Remove the timer interrupt.
TCCR4B = _BV(CS40); // Default clock prescaler of 8.
TCCR4A = _BV(WGM40); // Set to defaults so PWM can work like normal (PWM, phase corrected, 8bit).

ISR(TIMER4_COMPA_vect) { // Timer interrupt vector.