2.1.28, initiation update to PXT v5.28.24 (#54)
This commit is contained in:
committed by
Peli de Halleux
parent
38a964516e
commit
5c114a0c57
@@ -1,31 +1,33 @@
|
||||
# Analog Pitch
|
||||
|
||||
Emits a Pulse With Modulation (PWM) signal to the current pitch [pin](/device/pins). Use [analog set pitch pin](/reference/pins/analog-set-pitch-pin) to set the current pitch pin.
|
||||
Emits a Pulse With Modulation (PWM) signal to the pin ``P0``.
|
||||
Use [analog set pitch pin](/reference/pins/analog-set-pitch-pin) to set the current pitch pin.
|
||||
|
||||
```sig
|
||||
pins.analogPitch(440, 300)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
## Parameters
|
||||
|
||||
* `frequency` : [Number](/reference/types/number)
|
||||
* `ms`: [Number](/reference/types/number)
|
||||
* `frequency` : [Number](/types/number)
|
||||
* `ms`: [Number](/types/number)
|
||||
|
||||
### Example
|
||||
## Example
|
||||
|
||||
```blocks
|
||||
pins.analogSetPitchPin("P0")
|
||||
pins.analogSetPitchPin(AnalogPin.P0);
|
||||
let frequency1 = 440
|
||||
let duration = 1000
|
||||
pins.analogSetPitchPin(AnalogPin.P1);
|
||||
pins.analogPitch(frequency1, duration)
|
||||
```
|
||||
|
||||
### Some common notes
|
||||
## Some common notes
|
||||
|
||||
* 440 = A4 on piano
|
||||
* see [piano key frequencies ](https://en.wikipedia.org/wiki/Piano_key_frequencies) for more information
|
||||
|
||||
### See also
|
||||
## See also
|
||||
|
||||
[@boardname@ pins](/device/pins), [analog set period](/reference/pins/analog-set-period), [analog set pitch pin](/reference/pins/analog-set-pitch-pin)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user