Framework (A-Z)

Reference for Wiring version 1.0 Build 0100+ If you have a previous version, use the reference included with your software. If see any errors or have any comments, let us know.

Name

noTone()

Examples
void setup() {
  // sets digital pin 8 as input to connect a switch
  pinMode(8, INPUT);  
  // generates a tone of 400Hz on output pin 7 with infinite duration
  tone(7, 400);  
}

void loop() {
  // if the switch is pressed stop the tone on pin 8
  if (digitalRead(8) == HIGH) {  
    noTone(7);  
  }
}
Description The noTone() method stops the tone generation in the specified output pin.
Syntax
noTone(pin)
Parameters
pin int: the output pin number to stop generating tone
Returns None
Usage Application
Related tone()
noTone()
setTonePolyphony()
getTonePolyphony()
Updated on July 07, 2011 11:08:45pm PDT

Creative Commons License