-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix help path for 'resume' * add ref page for 'set-audio-pin-enabled'
- Loading branch information
Showing
5 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# set Audio Pin Enabled | ||
|
||
Enable a pin on the edge connector to output audio. | ||
|
||
```sig | ||
pins.setAudioPinEnabled(false) | ||
``` | ||
|
||
You can enable the @boardname@ to output audio to a pin on the edge connector. | ||
|
||
### ~ hint | ||
|
||
#### micro:bit V2 speaker | ||
|
||
With the [micro:bit V2](/device/v2) 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. | ||
|
||
```blocks | ||
pins.setAudioPinEnabled(false) | ||
pins.setAudioPin(AnalogPin.P0) | ||
let frequency = 440 | ||
let duration = 1000 | ||
pins.analogPitch(frequency, duration) | ||
``` | ||
|
||
## See also | ||
|
||
[@boardname@ pins](/device/pins), [set audio pin](/reference/pins/set-audio-pin), | ||
[analog set pitch pin](/reference/pins/analog-set-pitch-pin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters