2.1.28, initiation update to PXT v5.28.24 (#54)

This commit is contained in:
Amerlander
2019-12-02 05:58:26 +01:00
committed by Peli de Halleux
parent 38a964516e
commit 5c114a0c57
1261 changed files with 50692 additions and 21604 deletions

View File

@@ -2,18 +2,20 @@
Play a musical tone through pin ``P0`` of the @boardname@ for as long as you say.
## Simulator
## ~ hint
This function only works on the @boardname@ and in some browsers.
## ~
```sig
music.playTone(440, 120)
```
### Parameters
## Parameters
* ``frequency`` is the [number](/reference/types/number) of Hertz (how high or low the tone is).
* ``ms`` is the [number](/reference/types/number) of milliseconds that the tone lasts
* ``frequency`` is the [number](/types/number) of Hertz (how high or low the tone is).
* ``ms`` is the [number](/types/number) of milliseconds that the tone lasts
## Example
@@ -25,7 +27,16 @@ let freq = music.noteFrequency(Note.C)
music.playTone(freq, 1000)
```
### See also
## Using other pins
Use [analogSetPitchPin](/reference/pins/analog-set-pitch-pin) to change that pin used to generate music.
```blocks
pins.analogSetPitchPin(AnalogPin.P1);
```
## See also
[rest](/reference/music/rest), [ring tone](/reference/music/ring-tone) , [tempo](/reference/music/tempo), [set tempo](/reference/music/set-tempo),
[change tempo by](/reference/music/change-tempo-by)