From c03fac216262ba8922a8d5077e681c450497af71 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 3 Nov 2016 08:50:02 -0700 Subject: [PATCH] fixing typos --- libs/core/_locales/core-jsdoc-strings.json | 4 ++-- libs/core/music.cpp | 4 ++-- libs/core/music.ts | 25 ---------------------- libs/core/shims.d.ts | 2 +- 4 files changed, 5 insertions(+), 30 deletions(-) diff --git a/libs/core/_locales/core-jsdoc-strings.json b/libs/core/_locales/core-jsdoc-strings.json index 58b2fd26..3f6ce130 100644 --- a/libs/core/_locales/core-jsdoc-strings.json +++ b/libs/core/_locales/core-jsdoc-strings.json @@ -109,12 +109,12 @@ "music.changeTempoBy|param|bpm": "The change in beats per minute to the tempo, eg: 20", "music.noteFrequency": "Gets the frequency of a note.", "music.noteFrequency|param|name": "the note name", - "music.playTone": "Plays a tone through pin ``P0`` for the given duration.", + "music.playTone": "Plays a tone through ``speaker`` for the given duration.", "music.playTone|param|frequency": "pitch of the tone to play in Hertz (Hz)", "music.playTone|param|ms": "tone duration in milliseconds (ms)", "music.rest": "Rests (plays nothing) for a specified time through pin ``P0``.", "music.rest|param|ms": "rest duration in milliseconds (ms)", - "music.ringTone": "Plays a tone through pin ``P0``.", + "music.ringTone": "Plays a tone through ``speaker``.", "music.ringTone|param|frequency": "pitch of the tone to play in Hertz (Hz)", "music.setTempo": "Sets the tempo to the specified amount", "music.setTempo|param|bpm": "The new tempo in beats per minute, eg: 120", diff --git a/libs/core/music.cpp b/libs/core/music.cpp index 0bde4657..f7292d78 100644 --- a/libs/core/music.cpp +++ b/libs/core/music.cpp @@ -9,8 +9,8 @@ namespace music { //% 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" async - void playTone(int freqency, int ms) { - uBit.soundmotor.Sound_On(freqency); + void playTone(int frequency, int ms) { + uBit.soundmotor.Sound_On(frequency); if(ms > 0) uBit.sleep(ms); uBit.soundmotor.Sound_Off(); } diff --git a/libs/core/music.ts b/libs/core/music.ts index 6b00e668..50882332 100644 --- a/libs/core/music.ts +++ b/libs/core/music.ts @@ -129,31 +129,6 @@ enum BeatFraction { namespace music { let beatsPerMinute: number = 120; - // /** - // * Plays a tone through pin ``P0`` 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" - // export function playTone(frequency: number, ms: number): void { - // pins.analogSetPitchPin(AnalogPin.P0); - // pins.analogPitch(frequency, ms); - // } - // - // /** - // * Plays a tone through pin ``P0``. - // * @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" - // export function ringTone(frequency: number): void { - // pins.analogSetPitchPin(AnalogPin.P0); - // pins.analogPitch(frequency, 0); - // } - /** * Rests (plays nothing) for a specified time through pin ``P0``. * @param ms rest duration in milliseconds (ms) diff --git a/libs/core/shims.d.ts b/libs/core/shims.d.ts index 25f3dd11..3a11cfa0 100644 --- a/libs/core/shims.d.ts +++ b/libs/core/shims.d.ts @@ -548,7 +548,7 @@ declare namespace music { //% 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" async shim=music::playTone - function playTone(freqency: number, ms: number): void; + function playTone(frequency: number, ms: number): void; /** * Plays a tone through ``speaker``.