* fix help path for 'resume'

* add ref page for 'set-audio-pin-enabled'
This commit is contained in:
Galen Nickel 2024-07-30 10:05:15 -07:00 коммит произвёл GitHub
Родитель 87593b1868
Коммит 0f801980bb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
5 изменённых файлов: 43 добавлений и 4 удалений

Просмотреть файл

@ -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)

Просмотреть файл

@ -31,4 +31,5 @@ pins.analogPitch(frequency, duration)
## See also
[@boardname@ pins](/device/pins), [analog set pitch pin](/reference/pins/analog-set-pitch-pin)
[@boardname@ pins](/device/pins), [set audio pin enabled](/reference/pins/set-audio-pin-enabled),
[analog set pitch pin](/reference/pins/analog-set-pitch-pin)

Просмотреть файл

@ -305,7 +305,7 @@ namespace game {
* Resumes the game rendering engine
*/
//% blockId=game_resume block="resume"
//% advanced=true blockGap=8 help=game/resumeP
//% advanced=true blockGap=8 help=game/resume
export function resume(): void {
_paused = false;
plot();

Просмотреть файл

@ -696,7 +696,7 @@ namespace pins {
*/
//% blockId=pin_set_audio_pin_enabled
//% block="set audio pin enabled $enabled"
//% weight=0
//% weight=0 help=pins/set-audio-pin-enabled
void setAudioPinEnabled(bool enabled) {
edgeConnectorSoundDisabled = !enabled;
#if MICROBIT_CODAL

2
libs/core/shims.d.ts поставляемый
Просмотреть файл

@ -1000,7 +1000,7 @@ declare namespace pins {
*/
//% blockId=pin_set_audio_pin_enabled
//% block="set audio pin enabled $enabled"
//% weight=0 shim=pins::setAudioPinEnabled
//% weight=0 help=pins/set-audio-pin-enabled shim=pins::setAudioPinEnabled
function setAudioPinEnabled(enabled: boolean): void;
}