PiDuino Library

noTone(pin)

Stops a generated tone at the specified pin.

Parameters

pin - The GPIO pin number.

Returns

None


Example

#include <Arduino.h>

int GPIO_PIN = 12; // GPIO12

void setup() {
	pinMode(GPIO_PIN, PWM_OUTPUT);
}

void loop() {
	// Set frequency tone to 1 KHz
	tone(GPIO_PIN, 1000);
	// Delay 5 seconds
	delay(5000);
	// Stop the tone
	noTone(GPIO_PIN);
	// Delay 5 seconds
	delay(5000);
}

Notes

GPIO PIN Available in RPi (40-pins) connector PWM channel
12 YES 0
13 YES 1
18 YES 0
19 YES 1
40 NO 0
41 NO 1
45 NO 1
52 NO 0
53 NO 1