fixed sounds in simulator
This commit is contained in:
parent
60e71e3e35
commit
e7aed1d162
@ -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);
|
||||
}
|
||||
|
@ -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": [
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user