pxt-calliope/docs/reference/music/play-tone.md
2016-04-13 08:27:45 -07:00

696 B

Play Tone

Plays a music tone through pin P0 for the given duration.

Simulator

Simulation of this function is available in many, but not all browsers.

music.playTone(440, 120)

Parameters

  • frequency : Number - the frequency of the note (in Herz)
  • ms: Number - the duration of the note (milliseconds)

Example

let freq = music.noteFrequency(Note.C)
music.playTone(freq, 1000)

See also

rest, ring tone , tempo, set tempo, change tempo by