[solved] Using tone() on timer 2 pin

Hi all,

Is it possible to use the tone() function to generate a tone on pin 3 or 11?
I know if you are using the tone() function there will be interference with the PWM output of those timer2 pins.

If you can, why can you make a tone and can't you use PWM? Isn't tone using a PWM signal?

Thank you in advance.

Best regards,
Thomas

P.s. for a minimal example, see below:

const byte tonePin = 3;

void setup(){}

void loop(){
  noTone(tonePin);
  delay(500);
  tone(tonePin, 1000, 500);
  delay(1000);
}

Isn't tone using a PWM signal?

No.
PWM is handled by the timer hardware where as the tone function simply uses the interrupt capabilities of the timer.

Thanks for the response. I tested and can indeed confirm that you can use all digital pins for making a tone.