tone() \ Language (API) \ Wiring ALPHA 1.0
Author: Hernando Barragán
Description: Wiring is an electronic sketchbook and hardware electronics for developing ideas. It is a context for learning fundamentals of computer programming and prototyping with electronics within the context of the electronic arts.
Keywords: Wiring, Processing, Interactive Media, Electronic Arts, Programming, C, C++, Hernando Barragán

Search wiring.org.co:

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

Name | ### tone()
Examples |
    void setup() {
      tone(0, 400, 200); // generates a 400Hz tone in output pin 0 with 200ms of duration
    }

    void loop() {

    }
    void setup() {
      tone(0, 400, -1); // generates a 400Hz tone in output pin 0 with infinite duration
    }

    void loop() {

    }
Description | The tone() generates a tone of a determined frequency in hertz on a specific pin with a specified duration. The tone command uses timer2 to generate the tone accurately. Use a negative number in duration for infinite duration.
Syntax |
    tone(pin, frequency, duration)
Parameters |
pin | int the output pin number in which the tone will be generated.
frequency | int: the frequency for the pulse in Hertz
duration | int: the tone duration in milliseconds or a negative number for infinite duration
Returns | None
Usage | Application
Related | noTone()

Updated on January 28, 2010 10:45:01pm PST