set Audio Pin Enabled

Enable a pin on the edge connector to output audio.

pins.setAudioPinEnabled(false)

You can enable the Calliope mini to output audio to a pin on the edge connector.

Calliope mini speaker

With the Calliope mini hardware, the built-in speaker will play (mirror) the same tones and music sent to the audio pin.

Parameters

  • enabled: audio is output to a pin is enabled if true, disabled if false.

Example

Enable audio output to a pin on the edge connector and play a tone for the “A4” note at pin P0 for 1 second.

pins.setAudioPinEnabled(false)
pins.setAudioPin(AnalogPin.P0)
let frequency = 440
let duration = 1000
pins.analogPitch(frequency, duration)

See also

Calliope mini pins, set audio pin, analog set pitch pin