tone() and noTone()

Produces a tone with the specified frequency on a pin. noTone() turns off the tone leaving the pin in output low state. Those functions are usefull to produce audio feedback to the user. tone() is not blocking - the tone is produced by the timer (GPT) as a background process. Functions tone()/noTone() requires Tone.h include file. tone() works only with fast pins defined via s_pin data type and hence can work only on pins 9–16. tone() uses GPT, so GPT can not be used simultaneously with tone(). tone(pin, frequency); pin the number of the pin on which you want to produce a tone (s_pin type) frequency frequency of the tone in Hertz none noTone(pin); pin the number of the pin on which you want to produce a tone (s_pin type) none
#include "Tone.h"

void setup() {
}

void loop() {
  tone(11, 440);
  delay(1000);
  noTone(11);
  delay(4000);
}