From e7aed1d162f091da2fada5796af16d4b77a4be2b Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Mon, 24 Oct 2016 23:17:16 -0700 Subject: [PATCH] fixed sounds in simulator --- libs/core/music.ts | 6 ++-- pxtarget.json | 70 ++++++++++++++++++++--------------------- sim/visuals/microbit.ts | 3 +- 3 files changed, 40 insertions(+), 39 deletions(-) diff --git a/libs/core/music.ts b/libs/core/music.ts index 9c3e43fb..1c6aaada 100644 --- a/libs/core/music.ts +++ b/libs/core/music.ts @@ -136,7 +136,7 @@ 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="headphone" + //% parts="speaker" export function playTone(frequency: number, ms: number): void { pins.analogSetPitchPin(AnalogPin.P0); pins.analogPitch(frequency, ms); @@ -148,7 +148,7 @@ namespace music { */ //% help=music/ring-tone weight=80 //% blockId=device_ring block="ring tone (Hz)|%note=device_note" icon="\uf025" blockGap=8 - //% parts="headphone" + //% parts="speaker" export function ringTone(frequency: number): void { pins.analogSetPitchPin(AnalogPin.P0); pins.analogPitch(frequency, 0); @@ -160,7 +160,7 @@ namespace music { */ //% help=music/rest weight=79 //% blockId=device_rest block="rest(ms)|%duration=device_beat" - //% parts="headphone" + //% parts="speaker" export function rest(ms: number): void { playTone(0, ms); } diff --git a/pxtarget.json b/pxtarget.json index 1acb4f89..f8e7e683 100644 --- a/pxtarget.json +++ b/pxtarget.json @@ -106,54 +106,54 @@ "visual": "calliope", "gpioPinBlocks": [ [ - "P0" + "EDGE_P0" ], [ - "P1" + "EDGE_P1" ], [ - "P2" + "EDGE_P2" ], [ - "P3" + "EDGE_P3" ], [ - "P4", - "P5", - "P6", - "P7" + "C_P4", + "C_P5", + "C_P6", + "C_P7" ], [ - "P8", - "P9", - "P10", - "P11", - "P12" + "C_P8", + "C_P9", + "C_P10", + "C_P11", + "C_P12" ], [ - "P16" + "C_P16" ] ], "gpioPinMap": { - "P0": "P0", - "P1": "P1", - "P2": "P2", - "P3": "P3", - "P4": "P4", - "P5": "P5", - "P6": "P6", - "P7": "P7", - "P8": "P8", - "P9": "P9", - "P10": "P10", - "P11": "P11", - "P12": "P12", - "P13": "P13", - "P14": "P14", - "P15": "P15", - "P16": "P16", - "P19": "P19", - "P20": "P20", + "P0": "EDGE_P0", + "P1": "EDGE_P1", + "P2": "EDGE_P2", + "P3": "EDGE_P3", + "P4": "C_P4", + "P5": "C_P5", + "P6": "C_P6", + "P7": "C_P7", + "P8": "C_P8", + "P9": "C_P9", + "P10": "C_P10", + "P11": "C_P11", + "P12": "C_P12", + "P13": "C_P13", + "P14": "C_P14", + "P15": "C_P15", + "P16": "C_P16", + "P19": "C_P19", + "P20": "C_P20", "EXT_PWR":"EXT_PWR", "SPKR":"EXT_PWR", "BTN_A": "BTN_A", @@ -178,10 +178,10 @@ "P10" ], "groundPins": [ - "GND" + "EDGE_GND" ], "threeVoltPins": [ - "+3v3" + "EDGE_VCC" ], "attachPowerOnRight": true, "onboardComponents": [ diff --git a/sim/visuals/microbit.ts b/sim/visuals/microbit.ts index 1a219bbd..cbb658a3 100644 --- a/sim/visuals/microbit.ts +++ b/sim/visuals/microbit.ts @@ -1077,6 +1077,7 @@ namespace pxsim.visuals { 204.92835235595703, 56.631452560424805 ], + // rings "EDGE_P0": [ 56.002254486083984, 95.43130111694336 @@ -1128,7 +1129,7 @@ namespace pxsim.visuals { "C_P0": [ 119.33667373657227, 159.83989715576172 - ], + ], "C_P2": [ 125.52401733398438, 159.83989715576172