Ring Tone

Play a musical tone through pin P0 with the pitch as high or low as you say. The tone will keep playing until you tell it not to.

Simulator

This function only works on the Calliope mini and in some browsers.

music.ringTone(440)

Parameters

Example

This program checks the accelerometer for the Calliope mini’s acceleration (how much the Calliope mini is speeding up or slowing down). Then it uses that acceleration to make a tone. If the Calliope mini speeds up, the tone’s pitch gets higher, and if it slows down, the tone’s pitch gets lower. It’s fun – try it!

basic.forever(() => {
    music.ringTone(input.acceleration(Dimension.X))
})

See also

rest, play tone, tempo, set tempo, change tempo by

Edit this page on GitHub