rev. 0.2 sound patches

This commit is contained in:
Matthias L. Jugel
2016-10-27 19:48:42 +02:00
parent 739be09ac9
commit 955b67b6b8
5 changed files with 218 additions and 49 deletions

21
libs/core/shims.d.ts vendored
View File

@ -524,6 +524,27 @@ declare namespace motors {
//% parts=dcmotor shim=motors::motorOn
function motorOn(power: number): void;
}
declare namespace music {
/**
* Plays a tone through ``speaker`` for the given duration.
* @param frequency pitch of the tone to play in Hertz (Hz)
* @param ms tone duration in milliseconds (ms)
*/
//% help=music/play-tone weight=90
//% blockId=device_play_note block="play|tone %note=device_note|for %duration=device_beat" icon="\uf025" blockGap=8
//% parts="speaker" shim=music::playTone
function playTone(freqency: number, ms: number): void;
/**
* Plays a tone through ``speaker``.
* @param frequency pitch of the tone to play in Hertz (Hz)
*/
//% help=music/ring-tone weight=80
//% blockId=device_ring block="ring tone (Hz)|%note=device_note" icon="\uf025" blockGap=8
//% parts="speaker" shim=music::ringTone
function ringTone(frequency: number): void;
}
declare namespace pins {
/**