This commit is contained in:
Peli de Halleux
2016-07-22 07:15:57 -07:00
4 changed files with 5 additions and 6 deletions

View File

@ -1,6 +1,6 @@
# 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 pitch pin.
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.
```sig
pins.analogPitch(440, 300)

View File

@ -28,9 +28,7 @@ basic.forever(() => {
#### ~hint
If you are using **analog read pin** with another micro:bit
running **analog write pin**, it is a good idea to check
**analog read pin** many times and then take an average.
If you are using **analog read pin** with another micro:bit running **analog write pin**, then things can get tricky. Remember that the micro:bit that runs **analog set pin** writes 0's and 1's at a very high frequency to achieve an average of the desired value. Sadly, if you try to read that average from another micro:bit, then the micro:bit will either read 0 or 1023. You could try to read a higher number of values (e.g. a million) in a loop, then computer then average. Alternatively, you can plug in a capacitor in-between the two micro:bits.
#### ~