pxt-microbit 7.0.25 → 7.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/built/block-tests.js +1 -1
- package/built/editor.js +175 -69
- package/built/fieldeditors.js +94 -4
- package/built/target-strings.json +1 -1
- package/built/target.js +1 -1
- package/built/target.json +1 -1
- package/built/targetlight.json +1 -1
- package/package.json +2 -2
- package/pxtarget.json +0 -1
- package/targetconfig.json +0 -1
- /package/built/hexcache/{9be45665f3abe402bef9a9bd8ed0ef1e4ecd9b578792c6f0d5d42d4f03d63ab4.hex → 05eabed0e13831468ab705d877bce2af1ddad770371d4246d7a07f4469346a71.hex} +0 -0
- /package/built/hexcache/{ed1952fd1d4c3257079d866091afb2bc4c6e99c65c80a55766953c8b2e7e9250.hex → 1e86d27c608bc4d414943e4b3577a78ae19018b6f4ceac92284e39128d77ee9b.hex} +0 -0
- /package/built/hexcache/{fbc8089808f65a1799837e03ee481088a737e25550deb72aa4dfbf7f154bdeab.hex → 2a2d60e65854c3da6a11a58b6c28d27afeea6199cf557028a33b37b160cadb85.hex} +0 -0
- /package/built/hexcache/{ab613458a27c70d929c05304c823bf0de9c378d461db7e1ddaebcd155e73752c.hex → 7519a023a160449c14db2f58014d94298e69fe017427cca5a8d7ab49c18ec249.hex} +0 -0
package/built/editor.js
CHANGED
|
@@ -3962,50 +3962,114 @@ exports.mkDAPLinkPacketIOWrapper = mkDAPLinkPacketIOWrapper;
|
|
|
3962
3962
|
|
|
3963
3963
|
},{}],4:[function(require,module,exports){
|
|
3964
3964
|
"use strict";
|
|
3965
|
-
/**
|
|
3966
|
-
* <block type="device_show_leds">
|
|
3967
|
-
<field name="LED00">FALSE</field>
|
|
3968
|
-
<field name="LED10">FALSE</field>
|
|
3969
|
-
<field name="LED20">FALSE</field>
|
|
3970
|
-
<field name="LED30">FALSE</field>
|
|
3971
|
-
<field name="LED40">FALSE</field>
|
|
3972
|
-
<field name="LED01">FALSE</field>
|
|
3973
|
-
<field name="LED11">FALSE</field>
|
|
3974
|
-
<field name="LED21">FALSE</field>
|
|
3975
|
-
<field name="LED31">TRUE</field>
|
|
3976
|
-
<field name="LED41">FALSE</field>
|
|
3977
|
-
<field name="LED02">FALSE</field>
|
|
3978
|
-
<field name="LED12">FALSE</field>
|
|
3979
|
-
<field name="LED22">FALSE</field>
|
|
3980
|
-
<field name="LED32">FALSE</field>
|
|
3981
|
-
<field name="LED42">FALSE</field>
|
|
3982
|
-
<field name="LED03">FALSE</field>
|
|
3983
|
-
<field name="LED13">TRUE</field>
|
|
3984
|
-
<field name="LED23">FALSE</field>
|
|
3985
|
-
<field name="LED33">FALSE</field>
|
|
3986
|
-
<field name="LED43">FALSE</field>
|
|
3987
|
-
<field name="LED04">FALSE</field>
|
|
3988
|
-
<field name="LED14">FALSE</field>
|
|
3989
|
-
<field name="LED24">FALSE</field>
|
|
3990
|
-
<field name="LED34">FALSE</field>
|
|
3991
|
-
<field name="LED44">FALSE</field>
|
|
3992
|
-
</block>
|
|
3993
|
-
|
|
3994
|
-
to
|
|
3995
|
-
<block type="device_show_leds">
|
|
3996
|
-
<field name="LEDS">`
|
|
3997
|
-
# # # # #
|
|
3998
|
-
. . . . #
|
|
3999
|
-
. . . . .
|
|
4000
|
-
. . . . #
|
|
4001
|
-
. . . . #
|
|
4002
|
-
`
|
|
4003
|
-
</field>
|
|
4004
|
-
</block>
|
|
4005
|
-
*/
|
|
4006
3965
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4007
3966
|
exports.patchBlocks = void 0;
|
|
4008
3967
|
function patchBlocks(pkgTargetVersion, dom) {
|
|
3968
|
+
if (pxt.semver.majorCmp(pkgTargetVersion || "0.0.0", "7.0.13") <= 0) {
|
|
3969
|
+
// Variable pin param
|
|
3970
|
+
/*
|
|
3971
|
+
<block type="device_get_digital_pin">
|
|
3972
|
+
<field name="name">DigitalPin.P0</field>
|
|
3973
|
+
</block>
|
|
3974
|
+
|
|
3975
|
+
converts to
|
|
3976
|
+
|
|
3977
|
+
<block type="device_get_digital_pin">
|
|
3978
|
+
<value name="name">
|
|
3979
|
+
<shadow type="digital_pin">
|
|
3980
|
+
<field name="pin">DigitalPin.P0</field>
|
|
3981
|
+
</shadow>
|
|
3982
|
+
</value>
|
|
3983
|
+
</block>
|
|
3984
|
+
*/
|
|
3985
|
+
pxt.U.toArray(dom.querySelectorAll("block[type=device_get_digital_pin]"))
|
|
3986
|
+
.concat(pxt.U.toArray(dom.querySelectorAll("shadow[type=device_get_digital_pin]")))
|
|
3987
|
+
.concat(pxt.U.toArray(dom.querySelectorAll("block[type=device_set_digital_pin]")))
|
|
3988
|
+
.concat(pxt.U.toArray(dom.querySelectorAll("block[type=device_get_analog_pin]")))
|
|
3989
|
+
.concat(pxt.U.toArray(dom.querySelectorAll("shadow[type=device_get_analog_pin]")))
|
|
3990
|
+
.concat(pxt.U.toArray(dom.querySelectorAll("block[type=device_set_analog_pin]")))
|
|
3991
|
+
.concat(pxt.U.toArray(dom.querySelectorAll("block[type=device_set_analog_period]")))
|
|
3992
|
+
.concat(pxt.U.toArray(dom.querySelectorAll("block[type=pins_on_pulsed]")))
|
|
3993
|
+
.concat(pxt.U.toArray(dom.querySelectorAll("block[type=pins_pulse_in]")))
|
|
3994
|
+
.concat(pxt.U.toArray(dom.querySelectorAll("shadow[type=pins_pulse_in]")))
|
|
3995
|
+
.concat(pxt.U.toArray(dom.querySelectorAll("block[type=device_set_servo_pin]")))
|
|
3996
|
+
.concat(pxt.U.toArray(dom.querySelectorAll("block[type=device_set_servo_pulse]")))
|
|
3997
|
+
.concat(pxt.U.toArray(dom.querySelectorAll("block[type=device_analog_set_pitch_pin]")))
|
|
3998
|
+
.concat(pxt.U.toArray(dom.querySelectorAll("block[type=device_set_pull]")))
|
|
3999
|
+
.concat(pxt.U.toArray(dom.querySelectorAll("block[type=device_set_pin_events]")))
|
|
4000
|
+
.concat(pxt.U.toArray(dom.querySelectorAll("block[type=pin_neopixel_matrix_width]")))
|
|
4001
|
+
.concat(pxt.U.toArray(dom.querySelectorAll("block[type=spi_pins]")))
|
|
4002
|
+
.concat(pxt.U.toArray(dom.querySelectorAll("block[type=pin_set_audio_pin]")))
|
|
4003
|
+
.forEach(node => {
|
|
4004
|
+
const blockType = node.getAttribute("type");
|
|
4005
|
+
pxt.U.toArray(node.children)
|
|
4006
|
+
.filter(oldPinNode => {
|
|
4007
|
+
if (oldPinNode.tagName != "field")
|
|
4008
|
+
return false;
|
|
4009
|
+
switch (blockType) {
|
|
4010
|
+
case "device_get_digital_pin":
|
|
4011
|
+
case "device_set_digital_pin":
|
|
4012
|
+
case "device_get_analog_pin":
|
|
4013
|
+
case "device_set_analog_pin":
|
|
4014
|
+
case "pins_pulse_in":
|
|
4015
|
+
case "device_set_servo_pin":
|
|
4016
|
+
case "device_analog_set_pitch_pin":
|
|
4017
|
+
case "pin_set_audio_pin":
|
|
4018
|
+
return oldPinNode.getAttribute("name") === "name";
|
|
4019
|
+
case "device_set_analog_period":
|
|
4020
|
+
case "pins_on_pulsed":
|
|
4021
|
+
case "device_set_pull":
|
|
4022
|
+
case "device_set_pin_events":
|
|
4023
|
+
case "pin_neopixel_matrix_width":
|
|
4024
|
+
return oldPinNode.getAttribute("name") === "pin";
|
|
4025
|
+
case "device_set_servo_pulse":
|
|
4026
|
+
return oldPinNode.getAttribute("name") === "value";
|
|
4027
|
+
case "spi_pins":
|
|
4028
|
+
return ["mosi", "miso", "sck"].includes(oldPinNode.getAttribute("name"));
|
|
4029
|
+
}
|
|
4030
|
+
return false;
|
|
4031
|
+
})
|
|
4032
|
+
.forEach(oldPinNode => {
|
|
4033
|
+
const valueNode = node.ownerDocument.createElement("value");
|
|
4034
|
+
valueNode.setAttribute("name", oldPinNode.getAttribute("name"));
|
|
4035
|
+
let nodeText = oldPinNode.textContent;
|
|
4036
|
+
const pinShadowNode = node.ownerDocument.createElement("shadow");
|
|
4037
|
+
const [enumName, pinName] = nodeText.split(".");
|
|
4038
|
+
let pinBlockType;
|
|
4039
|
+
switch (enumName) {
|
|
4040
|
+
case "DigitalPin":
|
|
4041
|
+
pinBlockType = "digital_pin_shadow";
|
|
4042
|
+
break;
|
|
4043
|
+
case "AnalogPin":
|
|
4044
|
+
pinBlockType = "analog_pin_shadow";
|
|
4045
|
+
break;
|
|
4046
|
+
}
|
|
4047
|
+
if (!pinBlockType)
|
|
4048
|
+
return;
|
|
4049
|
+
// If this is one of the read/write pins, narrow to the read write shadow
|
|
4050
|
+
if (blockType === "device_get_analog_pin") {
|
|
4051
|
+
switch (pinName) {
|
|
4052
|
+
case "P0":
|
|
4053
|
+
case "P1":
|
|
4054
|
+
case "P2":
|
|
4055
|
+
case "P3":
|
|
4056
|
+
case "P4":
|
|
4057
|
+
case "P10":
|
|
4058
|
+
pinBlockType = "analog_read_write_pin_shadow";
|
|
4059
|
+
nodeText = `AnalogReadWritePin.${pinName}`;
|
|
4060
|
+
break;
|
|
4061
|
+
}
|
|
4062
|
+
}
|
|
4063
|
+
pinShadowNode.setAttribute("type", pinBlockType);
|
|
4064
|
+
const fieldNode = node.ownerDocument.createElement("field");
|
|
4065
|
+
fieldNode.setAttribute("name", "pin");
|
|
4066
|
+
fieldNode.textContent = nodeText;
|
|
4067
|
+
pinShadowNode.appendChild(fieldNode);
|
|
4068
|
+
valueNode.appendChild(pinShadowNode);
|
|
4069
|
+
node.replaceChild(valueNode, oldPinNode);
|
|
4070
|
+
});
|
|
4071
|
+
});
|
|
4072
|
+
}
|
|
4009
4073
|
if (pxt.semver.majorCmp(pkgTargetVersion || "0.0.0", "5.0.12") <= 0) {
|
|
4010
4074
|
// Eighth note misspelling
|
|
4011
4075
|
/*
|
|
@@ -4041,12 +4105,54 @@ function patchBlocks(pkgTargetVersion, dom) {
|
|
|
4041
4105
|
if (pxt.semver.majorCmp(pkgTargetVersion || "0.0.0", "1.0.0") >= 0)
|
|
4042
4106
|
return;
|
|
4043
4107
|
// showleds
|
|
4044
|
-
|
|
4108
|
+
/**
|
|
4109
|
+
<block type="device_show_leds">
|
|
4110
|
+
<field name="LED00">FALSE</field>
|
|
4111
|
+
<field name="LED10">FALSE</field>
|
|
4112
|
+
<field name="LED20">FALSE</field>
|
|
4113
|
+
<field name="LED30">FALSE</field>
|
|
4114
|
+
<field name="LED40">FALSE</field>
|
|
4115
|
+
<field name="LED01">FALSE</field>
|
|
4116
|
+
<field name="LED11">FALSE</field>
|
|
4117
|
+
<field name="LED21">FALSE</field>
|
|
4118
|
+
<field name="LED31">TRUE</field>
|
|
4119
|
+
<field name="LED41">FALSE</field>
|
|
4120
|
+
<field name="LED02">FALSE</field>
|
|
4121
|
+
<field name="LED12">FALSE</field>
|
|
4122
|
+
<field name="LED22">FALSE</field>
|
|
4123
|
+
<field name="LED32">FALSE</field>
|
|
4124
|
+
<field name="LED42">FALSE</field>
|
|
4125
|
+
<field name="LED03">FALSE</field>
|
|
4126
|
+
<field name="LED13">TRUE</field>
|
|
4127
|
+
<field name="LED23">FALSE</field>
|
|
4128
|
+
<field name="LED33">FALSE</field>
|
|
4129
|
+
<field name="LED43">FALSE</field>
|
|
4130
|
+
<field name="LED04">FALSE</field>
|
|
4131
|
+
<field name="LED14">FALSE</field>
|
|
4132
|
+
<field name="LED24">FALSE</field>
|
|
4133
|
+
<field name="LED34">FALSE</field>
|
|
4134
|
+
<field name="LED44">FALSE</field>
|
|
4135
|
+
</block>
|
|
4136
|
+
|
|
4137
|
+
converts to
|
|
4138
|
+
|
|
4139
|
+
<block type="device_show_leds">
|
|
4140
|
+
<field name="LEDS">`
|
|
4141
|
+
. . . . .
|
|
4142
|
+
. . . # .
|
|
4143
|
+
. . . . .
|
|
4144
|
+
. # . . .
|
|
4145
|
+
. . . . .
|
|
4146
|
+
`
|
|
4147
|
+
</field>
|
|
4148
|
+
</block>
|
|
4149
|
+
*/
|
|
4150
|
+
pxt.U.toArray(dom.querySelectorAll("block[type=device_show_leds]"))
|
|
4045
4151
|
.concat(pxt.U.toArray(dom.querySelectorAll("block[type=device_build_image]")))
|
|
4046
4152
|
.concat(pxt.U.toArray(dom.querySelectorAll("shadow[type=device_build_image]")))
|
|
4047
4153
|
.concat(pxt.U.toArray(dom.querySelectorAll("block[type=device_build_big_image]")))
|
|
4048
|
-
.concat(pxt.U.toArray(dom.querySelectorAll("shadow[type=device_build_big_image]")))
|
|
4049
|
-
|
|
4154
|
+
.concat(pxt.U.toArray(dom.querySelectorAll("shadow[type=device_build_big_image]")))
|
|
4155
|
+
.forEach(node => {
|
|
4050
4156
|
// don't rewrite if already upgraded, eg. field LEDS already present
|
|
4051
4157
|
if (pxt.U.toArray(node.children).filter(child => child.tagName == "field" && "LEDS" == child.getAttribute("name"))[0])
|
|
4052
4158
|
return;
|
|
@@ -4071,33 +4177,33 @@ function patchBlocks(pkgTargetVersion, dom) {
|
|
|
4071
4177
|
});
|
|
4072
4178
|
// radio
|
|
4073
4179
|
/*
|
|
4074
|
-
<block type="radio_on_packet" x="174" y="120">
|
|
4075
|
-
<mutation callbackproperties="receivedNumber" renamemap="{}"></mutation>
|
|
4076
|
-
<field name="receivedNumber">receivedNumber</field>
|
|
4077
|
-
</block>
|
|
4078
|
-
<block type="radio_on_packet" disabled="true" x="127" y="263">
|
|
4079
|
-
<mutation callbackproperties="receivedString,receivedNumber" renamemap="{"receivedString":"name","receivedNumber":"value"}"></mutation>
|
|
4080
|
-
<field name="receivedString">name</field>
|
|
4081
|
-
<field name="receivedNumber">value</field>
|
|
4082
|
-
</block>
|
|
4083
|
-
<block type="radio_on_packet" disabled="true" x="162" y="420">
|
|
4084
|
-
<mutation callbackproperties="receivedString" renamemap="{}"></mutation>
|
|
4085
|
-
<field name="receivedString">receivedString</field>
|
|
4086
|
-
</block>
|
|
4180
|
+
<block type="radio_on_packet" x="174" y="120">
|
|
4181
|
+
<mutation callbackproperties="receivedNumber" renamemap="{}"></mutation>
|
|
4182
|
+
<field name="receivedNumber">receivedNumber</field>
|
|
4183
|
+
</block>
|
|
4184
|
+
<block type="radio_on_packet" disabled="true" x="127" y="263">
|
|
4185
|
+
<mutation callbackproperties="receivedString,receivedNumber" renamemap="{"receivedString":"name","receivedNumber":"value"}"></mutation>
|
|
4186
|
+
<field name="receivedString">name</field>
|
|
4187
|
+
<field name="receivedNumber">value</field>
|
|
4188
|
+
</block>
|
|
4189
|
+
<block type="radio_on_packet" disabled="true" x="162" y="420">
|
|
4190
|
+
<mutation callbackproperties="receivedString" renamemap="{}"></mutation>
|
|
4191
|
+
<field name="receivedString">receivedString</field>
|
|
4192
|
+
</block>
|
|
4087
4193
|
|
|
4088
|
-
converts to
|
|
4194
|
+
converts to
|
|
4089
4195
|
|
|
4090
|
-
<block type="radio_on_number" x="196" y="208">
|
|
4091
|
-
<field name="HANDLER_receivedNumber" id="DCy(W;1)*jLWQUpoy4Mm" variabletype="">receivedNumber</field>
|
|
4092
|
-
</block>
|
|
4093
|
-
<block type="radio_on_value" x="134" y="408">
|
|
4094
|
-
<field name="HANDLER_name" id="*d-Jm^MJXO]Djs(dTR*?" variabletype="">name</field>
|
|
4095
|
-
<field name="HANDLER_value" id="A6HQjH[k^X43o3h775+G" variabletype="">value</field>
|
|
4096
|
-
</block>
|
|
4097
|
-
<block type="radio_on_string" x="165" y="583">
|
|
4098
|
-
<field name="HANDLER_receivedString" id="V9KsE!h$(iO?%W:[32CV" variabletype="">receivedString</field>
|
|
4099
|
-
</block>
|
|
4100
|
-
*/
|
|
4196
|
+
<block type="radio_on_number" x="196" y="208">
|
|
4197
|
+
<field name="HANDLER_receivedNumber" id="DCy(W;1)*jLWQUpoy4Mm" variabletype="">receivedNumber</field>
|
|
4198
|
+
</block>
|
|
4199
|
+
<block type="radio_on_value" x="134" y="408">
|
|
4200
|
+
<field name="HANDLER_name" id="*d-Jm^MJXO]Djs(dTR*?" variabletype="">name</field>
|
|
4201
|
+
<field name="HANDLER_value" id="A6HQjH[k^X43o3h775+G" variabletype="">value</field>
|
|
4202
|
+
</block>
|
|
4203
|
+
<block type="radio_on_string" x="165" y="583">
|
|
4204
|
+
<field name="HANDLER_receivedString" id="V9KsE!h$(iO?%W:[32CV" variabletype="">receivedString</field>
|
|
4205
|
+
</block>
|
|
4206
|
+
*/
|
|
4101
4207
|
const varids = {};
|
|
4102
4208
|
function addField(node, renameMap, name) {
|
|
4103
4209
|
const f = node.ownerDocument.createElement("field");
|
package/built/fieldeditors.js
CHANGED
|
@@ -4,18 +4,25 @@
|
|
|
4
4
|
/// <reference path="../node_modules/pxt-core/built/pxtsim.d.ts"/>
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const field_gestures_1 = require("./field_gestures");
|
|
7
|
+
const field_pinPicker_1 = require("./field_pinPicker");
|
|
7
8
|
pxt.editor.initFieldExtensionsAsync = function (opts) {
|
|
8
9
|
pxt.debug('loading pxt-microbit field editors...');
|
|
9
10
|
const res = {
|
|
10
|
-
fieldEditors: [
|
|
11
|
+
fieldEditors: [
|
|
12
|
+
{
|
|
11
13
|
selector: "gestures",
|
|
12
14
|
editor: field_gestures_1.FieldGestures
|
|
13
|
-
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
selector: "pinpicker",
|
|
18
|
+
editor: field_pinPicker_1.FieldPinPicker
|
|
19
|
+
}
|
|
20
|
+
]
|
|
14
21
|
};
|
|
15
22
|
return Promise.resolve(res);
|
|
16
23
|
};
|
|
17
24
|
|
|
18
|
-
},{"./field_gestures":2}],2:[function(require,module,exports){
|
|
25
|
+
},{"./field_gestures":2,"./field_pinPicker":3}],2:[function(require,module,exports){
|
|
19
26
|
"use strict";
|
|
20
27
|
/// <reference path="../node_modules/pxt-core/localtypings/pxtblockly.d.ts"/>
|
|
21
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -95,4 +102,87 @@ class FieldGestures extends pxtblockly.FieldImages {
|
|
|
95
102
|
}
|
|
96
103
|
exports.FieldGestures = FieldGestures;
|
|
97
104
|
|
|
98
|
-
},{}]
|
|
105
|
+
},{}],3:[function(require,module,exports){
|
|
106
|
+
"use strict";
|
|
107
|
+
/// <reference path="../node_modules/pxt-core/localtypings/pxtblockly.d.ts"/>
|
|
108
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
109
|
+
exports.FieldPinPicker = void 0;
|
|
110
|
+
const pxtblockly = pxt.blocks.requirePxtBlockly();
|
|
111
|
+
const Blockly = pxt.blocks.requireBlockly();
|
|
112
|
+
const WARNING_ID = "pinpicker_warning";
|
|
113
|
+
class FieldPinPicker extends pxtblockly.FieldGridPicker {
|
|
114
|
+
constructor() {
|
|
115
|
+
super(...arguments);
|
|
116
|
+
this.changeListener = (e) => {
|
|
117
|
+
if (e.type === Blockly.Events.BLOCK_MOVE && e.blockId === this.sourceBlock_.id) {
|
|
118
|
+
this.updateWarning();
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
init() {
|
|
123
|
+
super.init();
|
|
124
|
+
const sourceBlock = this.sourceBlock_;
|
|
125
|
+
if (sourceBlock.isShadow() || sourceBlock.isInFlyout) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
sourceBlock.workspace.addChangeListener(this.changeListener);
|
|
129
|
+
}
|
|
130
|
+
doValueUpdate_(newValue) {
|
|
131
|
+
super.doValueUpdate_(newValue);
|
|
132
|
+
this.updateWarning();
|
|
133
|
+
}
|
|
134
|
+
updateWarning() {
|
|
135
|
+
this.hideWarning();
|
|
136
|
+
const sourceBlock = this.sourceBlock_;
|
|
137
|
+
if (!sourceBlock || !this.value_ || sourceBlock.isShadow() || sourceBlock.isInFlyout) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const pin = this.value_.split(".")[1];
|
|
141
|
+
if (!isAnalogWriteOnlyPin(pin)) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const parent = sourceBlock.outputConnection.targetBlock();
|
|
145
|
+
if (!parent || parent.type !== "device_get_analog_pin") {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
this.showWarning(pin);
|
|
149
|
+
}
|
|
150
|
+
showWarning(pin) {
|
|
151
|
+
if (!this.sourceBlock_) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
this.sourceBlock_.setWarningText(pxt.U.lf("{0} is a write only analog pin", pin), WARNING_ID);
|
|
155
|
+
}
|
|
156
|
+
hideWarning() {
|
|
157
|
+
if (!this.sourceBlock_) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
this.sourceBlock_.setWarningText(null, WARNING_ID);
|
|
161
|
+
}
|
|
162
|
+
dispose() {
|
|
163
|
+
var _a, _b;
|
|
164
|
+
super.dispose();
|
|
165
|
+
(_b = (_a = this.sourceBlock_) === null || _a === void 0 ? void 0 : _a.workspace) === null || _b === void 0 ? void 0 : _b.removeChangeListener(this.changeListener);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
exports.FieldPinPicker = FieldPinPicker;
|
|
169
|
+
function isAnalogWriteOnlyPin(pin) {
|
|
170
|
+
switch (pin) {
|
|
171
|
+
case "P5":
|
|
172
|
+
case "P6":
|
|
173
|
+
case "P7":
|
|
174
|
+
case "P8":
|
|
175
|
+
case "P9":
|
|
176
|
+
case "P11":
|
|
177
|
+
case "P12":
|
|
178
|
+
case "P13":
|
|
179
|
+
case "P14":
|
|
180
|
+
case "P15":
|
|
181
|
+
case "P16":
|
|
182
|
+
return true;
|
|
183
|
+
default:
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
},{}]},{},[1,2,3]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"A Blocks / JavaScript code editor for the micro:bit powered by Microsoft MakeCode.":"A Blocks / JavaScript code editor for the micro:bit powered by Microsoft MakeCode.","A micro-servo library":"A micro-servo library","Adds new blocks for message communication in the radio category":"Adds new blocks for message communication in the radio category","BETA - Camera, remote control and other Bluetooth services. App required.":"BETA - Camera, remote control and other Bluetooth services. App required.","Behind the MakeCode Hardware":"Behind the MakeCode Hardware","Blocks to JavaScript":"Blocks to JavaScript","Bluetooth services":"Bluetooth services","Buy":"Buy","Can't import microbit.co.uk scripts...":"Can't import microbit.co.uk scripts...","Coding Cards":"Coding Cards","Coding for Teachers":"Coding for Teachers","Color manipulation":"Color manipulation","Courses":"Courses","Data logging to flash memory. micro:bit (V2) only.":"Data logging to flash memory. micro:bit (V2) only.","Data logging to flash.":"Data logging to flash.","Deep Dive":"Deep Dive","Disable Bluetooth Event Service":"Disable Bluetooth Event Service","Download cancelled":"Download cancelled","Download failed, please try again":"Download failed, please try again","Download for V2 only":"Download for V2 only","Fashion":"Fashion","
|
|
1
|
+
{"A Blocks / JavaScript code editor for the micro:bit powered by Microsoft MakeCode.":"A Blocks / JavaScript code editor for the micro:bit powered by Microsoft MakeCode.","A micro-servo library":"A micro-servo library","Adds new blocks for message communication in the radio category":"Adds new blocks for message communication in the radio category","BETA - Camera, remote control and other Bluetooth services. App required.":"BETA - Camera, remote control and other Bluetooth services. App required.","Behind the MakeCode Hardware":"Behind the MakeCode Hardware","Blocks to JavaScript":"Blocks to JavaScript","Bluetooth services":"Bluetooth services","Buy":"Buy","Can't import microbit.co.uk scripts...":"Can't import microbit.co.uk scripts...","Coding Cards":"Coding Cards","Coding for Teachers":"Coding for Teachers","Color manipulation":"Color manipulation","Courses":"Courses","Data logging to flash memory. micro:bit (V2) only.":"Data logging to flash memory. micro:bit (V2) only.","Data logging to flash.":"Data logging to flash.","Deep Dive":"Deep Dive","Disable Bluetooth Event Service":"Disable Bluetooth Event Service","Download cancelled":"Download cancelled","Download failed, please try again":"Download failed, please try again","Download for V2 only":"Download for V2 only","Fashion":"Fashion","Games":"Games","Go Back":"Go Back","Go to the old editor":"Go to the old editor","Great coding skills! Unfortunately, your program is too large to fit on a micro:bit V1😢. You can go back and try to make your program smaller, or you can download your program onto a micro:bit V2.":"Great coding skills! Unfortunately, your program is too large to fit on a micro:bit V1😢. You can go back and try to make your program smaller, or you can download your program onto a micro:bit V2.","Great coding skills! Unfortunately, your program is too large to fit on a micro:bit V2😢. You can go back and try to make your program smaller, or continue to use the simulator to run your code.":"Great coding skills! Unfortunately, your program is too large to fit on a micro:bit V2😢. You can go back and try to make your program smaller, or continue to use the simulator to run your code.","Hardware":"Hardware","Importing microbit.co.uk programs is not supported in this editor anymore. Please open this script in the https://makecode.microbit.org/v0 editor.":"Importing microbit.co.uk programs is not supported in this editor anymore. Please open this script in the https://makecode.microbit.org/v0 editor.","Jacdac":"Jacdac","JustWorks pairing (default): Pairing is automatic once the pairing is initiated.":"JustWorks pairing (default): Pairing is automatic once the pairing is initiated.","Live Coding":"Live Coding","MicroCode for the new micro:bit (V2)":"MicroCode for the new micro:bit (V2)","Microsoft MakeCode for micro:bit":"Microsoft MakeCode for micro:bit","Music":"Music","New? Start here!":"New? Start here!","No Pairing Required: Anyone can connect via Bluetooth.":"No Pairing Required: Anyone can connect via Bluetooth.","Oops, there was a problem downloading your code":"Oops, there was a problem downloading your code","Passkey pairing: Pairing requires 6 digit key to pair.":"Passkey pairing: Pairing requires 6 digit key to pair.","Radio Games":"Radio Games","Record sound clips. micro:bit (V2) only":"Record sound clips. micro:bit (V2) only","Reference":"Reference","Science":"Science","Science Experiments":"Science Experiments","Settings storage in internal flash":"Settings storage in internal flash","Support":"Support","The microbit core library":"The microbit core library","The microphone library":"The microphone library","The radio services":"The radio services","Tools":"Tools","Toys":"Toys","Turtle":"Turtle","Tutorials":"Tutorials","Tutorials for the new micro:bit (V2)":"Tutorials for the new micro:bit (V2)","makecode.microbit.org":"makecode.microbit.org","{0} is a write only analog pin":"{0} is a write only analog pin","{id:extension-tag}Gaming":"Gaming","{id:extension-tag}Lights and Display":"Lights and Display","{id:extension-tag}Networking":"Networking","{id:extension-tag}Robotics":"Robotics","{id:extension-tag}Science":"Science","{id:extension-tag}Software":"Software","{id:type}Image":"Image","{id:type}LedSprite":"LedSprite","{id:var}image":"image","{id:var}sprite":"sprite"}
|