chipKIT® Development Platform

Inspired by Arduino™

Last edit: 2021-03-21 22:34 by Majenko

Tone

  1. Synopsis

  2. Description

  3. Return Value

  4. Conforming To

  5. Examples

  6. See Also

Synopsis

 void tone(uint8_t pin, unsigned int frequency, unsigned long duration)

Description

Generate a tone (square wave) on an I/O pin at frequency Hz. If duration is greater than 0 the tone will play for the specified number of milliseconds. If duration is less than 0 it will be generated indefinitely until noTone() is called. If duration is 0 it acts the same as if noTone() had been called.

Return Value

None

Conforming To

tone() conforms to the Arduino 1.6.x API.

Examples

Play a 1 second 2KHz tone:

 tone(3, 2000, 1000);

See Also

noTone()